🐘
clib Databases
postgresql
PostgreSQL client wrapping libpq. Execute queries, use parameterized statements to prevent SQL injection, and manage transactions.
Install ppm install postgresql
Usage Example
uses postgresql; var conn := Connect('host=localhost port=5432 dbname=mydb user=me password=secret'); // DDL Execute(conn, 'CREATE TABLE IF NOT EXISTS users (id SERIAL PRIMARY KEY, name TEXT)'); // Parameterized query (SQL injection safe) var res := QueryParams(conn, 'SELECT * FROM users WHERE id = $1', ['42']); for var row in res.Rows do WriteLn(row['name']); Close(conn);
Features
Parameterized queries (SQL injection safe)
Full PostgreSQL 14+ support
Transaction support (BEGIN/COMMIT/ROLLBACK)
COPY bulk import/export
libpq native performance
← Back to Package Index