db/postgres#

type connection

A connection to a Postgresql database.

meth connection(Settings: map): connection

Connects to a Postgresql database with the supplied settings.

meth connection(Name₁ is Value₁, ...): connection

Connects to a Postgresql database with the supplied settings.

meth (Arg₁: connection):connect

TBD

meth (Arg₁: connection):connected

TBD

meth (Connection: connection):prepare(SQL: string): statement

Creates a prepared statement on Connection.

meth (Connection: connection):query(SQL: string, Arg: any, ...): list[tuple] | nil

Executes SQL on Connection, with arguments Argᵢ if supplied. Returns a list of tuples (for SELECT, etc) or nil for commands without results.

meth (Arg₁: connection):reconnect(Arg₂: number)

TBD

type statement < function

A prepared statement. Calling a statement executes the prepared statement on the associated connection, with the provided arguments (if any).