finds.dev← search

// the find

go-jet/jet

★ 3,741 · Go · Apache-2.0 · updated Jun 2026

Type safe SQL builder with code generation and automatic query result data mapping

Jet is a type-safe SQL builder for Go that generates Go types from your database schema and maps query results to arbitrary structs. It sits between raw `database/sql` and a full ORM — you write SQL in Go syntax with compile-time column type checking, and it handles the tedious result scanning. Aimed at Go developers who want SQL control without string queries and manual row scanning.

The result mapping is genuinely clever: you define a destination struct with nested slices and it figures out how to populate it from a flat result set, handling one-to-many joins correctly without N+1 queries. Column type safety is enforced at compile time — comparing a string column to an integer literal won't compile, and renaming a database column breaks the build on the next generator run rather than at runtime. The SELECT_JSON support lets Postgres do the aggregation and return a single row of JSON, which cuts latency on deeply nested results. The generator is customizable enough that you can replace templates if the default naming conventions don't match your conventions.

The dot-import pattern the README recommends to make queries read like SQL is a bad habit in Go — it pollutes the package namespace and makes it hard to tell which identifiers come from where, especially in larger files with multiple schemas. The regeneration workflow is manual friction: schema changes require re-running the generator, committing the generated files, and keeping generated code in version control, which creates noisy diffs. No support for database migrations — you still need a separate tool for that, so Jet only solves half of the database layer problem. Releases are infrequent (twice a year by design), so if you hit a bug or need a dialect feature, you're waiting or patching yourself.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →