Tins · Storage & databases

postgres

A PostgreSQL client over libpq: parameterized statements, typed text-format results, transactions with savepoints and COPY, every error carrying its SQLSTATE — and, in a module of its own, a connection pool for a threaded service. A fork of dvirarad/mojo-postgres, rewritten for the 1.x toolchain.

Install
pixi shelf add postgres-mojo
Version

0.3.3 on mojoshelf

Source

What it does

Works today

  • Every §5 type, with NULL distinct from empty and numeric kept as text
  • PQexecParams and prepared statements — no values escaped into SQL
  • COPY in and out at 5 M rows/s; handles co-own the connection
  • A bounded ConnectionPool behind with pool.lease(): acquire timeouts, is_alive-checked checkout, lifetime and idle recycling, ROLLBACK on return
  • A connection whose statement or transaction outlives its lease is closed, never handed to a second thread
  • Tested against a throwaway cluster on every CI leg — no Docker

Correctness

Checked against psycopg 3 and psql — cell-exact, both directions

Also in Storage & databases