finds.dev

haskell-beam/beam

A type-safe Haskell SQL library

View on GitHubHomepage ↗

★ 637Haskellupdated Oct 2026

// the take

Beam is a type-safe SQL library for Haskell, mapping tables to plain Haskell records (no Template Haskell) and checking queries at compile time. It targets Haskell developers who want SQL-shaped queries validated by the type system, with pluggable backends for Postgres, SQLite, and DuckDB.

Backends are genuinely decoupled - beam-core defines the DSL and Postgres/SQLite/DuckDB backends plug in independently, so beam-mysql and beam-firebird exist as separate repos without forking the core. It deliberately stays out of connection and transaction management, letting you use postgresql-simple or sqlite-simple directly and only reach for beam when writing queries, which avoids the usual ORM trap of fighting the library during a transaction. The documentation pipeline actually executes every example query against a live Chinook database at doc-build time, so the user guide can't silently drift from what compiles. Generated SQL is close to the SQL92/99/2003 feature set rather than a lowest-common-denominator subset, and the output is readable, not mangled.

It's a small, mostly single-maintainer project (tathougies) with 637 stars after years of existence - the Haskell ORM space is thin, and you're betting on continued attention from one or two people. MySQL and Firebird support live in separate, independently-maintained repos, so there's no guarantee they track beam-core's releases or get the same testing rigor as the in-tree Postgres/SQLite/DuckDB backends. The query DSL's type-level machinery (seen throughout Query/Internal.hs and the Schema/Tables generics) means compile errors can get gnarly fast, and ramp-up time for anyone not already comfortable with Haskell's type system is real. DuckDB support looks newer than the rest (recent addition alongside the other backends) and hasn't had the same years of production mileage as beam-postgres.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
637
Forks
193
Language
Haskell
Last commit
7 Oct 2026

// nearby

If beam isn't quite it.

All repos →