Zig program accessing Postgresql using libpq C library
Command to run postgresql server in docker with port 25432.
Open a terminal window and run ...
Install libpq ( in macosx ).
Setup useful environment variables.
export ZIG_SYSTEM_LINKER_HACK=1
Install zig using asdf ( how to install asdf is out of this scope )
Compile this program
zig build-exe -lc -l pq -L/usr/local/Cellar/libpq/13.3/lib/ -I/usr/local/Cellar/libpq/13.3/include zig-pg-demo.zig
Run the program
./zig-pg-demo 127.0.0.1 25432 postgres postgres postgres
### Previous command stands for ./zig-pg-demo <host> <port> <user> <password> <database>