# postgres

> postgres, a magmalake tin: 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.

[magmalake](https://magmalake.dev/) [postgres](https://magmalake.dev/s/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

[GitHub](https://github.com/magmalake/postgres.mojo) [README](https://github.com/magmalake/postgres.mojo#readme)

## 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

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

- [objectstore](https://magmalake.dev/s/objectstore) local · HTTP · S3 · GCS · Azure · concurrent reads
- [sqlite](https://magmalake.dev/s/sqlite) embedded SQL · the catalog store
- [Every tin](https://magmalake.dev/tins)

[A magmalake project](https://magmalake.dev/)

Apache 2.0 · © 2026 Marius Seritan
