{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreibjw43mkmiyjwqx5yx7rs7udubu6n6yg5pjomlg2odmlyjxhjsbse",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3migo6ngsbku2"
},
"path": "/t/ann-pgenie-a-sql-first-code-generator-for-postgresql-no-dsls-no-orms-no-hand-rolled-codecs/13869#post_1",
"publishedAt": "2026-04-01T10:22:10.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"pgenie.io",
"pgenie.io/docs",
"github.com/pgenie-io/demo",
"github.com/pgenie-io/pgenie",
"GitHub star"
],
"textContent": "Hello colleagues,\n\nI’m Nikita Volkov, the author of “hasql”. After “hasql-th” brought compile-time SQL syntax checking a few years back, one significant gap remained: the validation of query compatibility with the actual database schema. Another concern coming from users has long been the need to hand-roll encoders and decoders for every query.\n\nToday I’m releasing **pGenie** - a tool that completely rethinks the way we integrate with Postgres from Haskell and it addresses these pain points and so much more!\n\n## What it does\n\nYou give pGenie two things:\n\n 1. Your **SQL migration files** (plain `CREATE TABLE …`, `ALTER …`, etc.)\n\n 2. Your **SQL query files** (plain `SELECT …`, `INSERT …`, etc.)\n\n\n\n\nIt executes them against real PostgreSQL via a Docker container, validates queries against your schema, and **generates a fully type-safe Haskell SDK** on top of “hasql”. There is no DSL to learn, no Template Haskell, no ORM layer. Postgres itself is the single source of truth.\n\nBesides Haskell it also generates Rust and actually has a decentralized codegen ecosystem that allows you to write your own codegens in beautiful **Dhall** and distribute them however you like.\n\nAs the cherry on top, pGenie also automates index management to some extent.\n\n## Links\n\n * **Landing page:** pgenie.io\n\n * **Docs and quickstart:** pgenie.io/docs\n\n * **Demo:** github.com/pgenie-io/demo\n\n * **Source:** github.com/pgenie-io/pgenie\n\n\n\n\npGenie is free and open source. I’d be grateful for feedback, bug reports, and a GitHub star if you find it useful!",
"title": "ANN: pGenie – a SQL-first code generator for PostgreSQL: no DSLs, no ORMs, no hand-rolled codecs"
}