// the find
src-d/go-kallax
Kallax is a PostgreSQL typesafe ORM for the Go language.
Kallax is a code-generation-based PostgreSQL ORM for Go: you write plain structs, run `go generate`, and it spits out a typesafe store, query builder, and schema for each model. It's aimed at teams who want compile-time-checked queries (no string column names) without hand-writing SQL, and who are fine being locked to Postgres.
The Schema.User.Username pattern is real type safety, not just a marketing claim — rename a field and every query referencing it breaks at compile time instead of failing silently at runtime like GORM's string-tag lookups. Nullable fields are handled by plain pointers instead of forcing sql.NullInt64/sql.NullString everywhere, which keeps model structs readable. 1:N relationship loading batches in groups of 50 to avoid the N+1 problem, and the included benchmarks actually back this up with numbers against GORM, SQLBoiler, and raw database/sql instead of just asserting it's fast.
The project is dead — last push was December 2022, and src-d as a company folded years before that, so this is running on inertia, not maintenance. It only ever supported one primary key column with no composite key support, which will block anyone with a non-trivial existing schema. Being Postgres-only and requiring a generated kallax.go per package is a real commitment: schema changes mean regenerating and recompiling, and the generator CLI has to be installed and kept on PATH separately from your module deps. It also depends on gofrs/uuid and the abandoned satori/go.uuid, both showing their age next to the standard library's uuid handling in newer ORMs.