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, which is not a valid Ecko identifier. Alias it to postgres in the dependencies block of 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.30.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).