postgres

A PostgreSQL client written in Ecko: v3 wire protocol + SCRAM-SHA-256 over std.net.

ecko get github.com/ecko-lang/postgresql-client
import postgres

ecko get records this under postgresql_client. This page imports it as postgres - fetch it with ecko get github.com/ecko-lang/postgresql-client --as postgres to record that name instead, or rename the key in your ecko.json.

Declares net. A capability is only advisory in the manifest: what the package actually gets is the grant you give it when you import it.

Version 0.37.0 - source - MIT.


connect(cfg)

connect({ host, port, user, password, database }) -> a connection handle.

connect_tls(cfg)

Connect to PostgreSQL over TLS and complete authentication. Same cfg as connect. Needs the net capability.

close(sock)

Close the connection.

query(sock, sql, params = [])

query(sock, sql) runs a simple text query. query(sock, sql, params) runs the extended protocol with $1..$N placeholders bound out-of-band (injection-safe).