DEV.co
Open-Source Databases · go-jet

jet

Jet is a Go-based type-safe SQL query builder with code generation that maps database schemas to Go types and automatically binds query results. It supports PostgreSQL, MySQL, SQLite, and compatible databases like CockroachDB and MariaDB, eliminating SQL string construction and manual result mapping.

Source: GitHub — github.com/go-jet/jet
3.7k
GitHub stars
185
Forks
Go
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorygo-jet/jet
Ownergo-jet
Primary languageGo
LicenseApache-2.0 — OSI-approved
Stars3.7k
Forks185
Open issues42
Latest releasev2.15.0 (2026-05-21)
Last updated2026-06-22
Sourcehttps://github.com/go-jet/jet

What jet is

Jet generates strongly-typed SQL builder packages and data model types from database schema metadata. It provides compile-time query validation, supports complex SELECT/INSERT/UPDATE/DELETE statements with CTEs, window functions, and subqueries, and handles result mapping to arbitrary Go struct compositions without reflection overhead.

Quickstart

Get the jet source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/go-jet/jet.gitcd jet# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Type-safe database access in Go microservices

Jet eliminates string-based SQL and runtime type errors by generating compile-time-checked query builders. Ideal for teams building microservices where type safety and early error detection reduce debugging time.

Complex analytical or reporting queries

Jet's support for window functions, CTEs, UNION/INTERSECT/EXCEPT, and complex joins makes it suitable for building reporting layers without hand-writing SQL strings or maintaining separate query files.

Multi-database support with schema evolution

Generator-based approach allows quick regeneration when schema changes. Works with PostgreSQL, MySQL, SQLite, CockroachDB, and MariaDB, enabling code-first database abstraction across database engines.

Implementation considerations

  • Code generation must be run each time schema changes; integrate into build pipeline (e.g., go generate) to keep types in sync and avoid stale generated code.
  • Requires active database connection during generation; user must have schema inspection permissions; credential management and environment-specific generation (dev/staging/prod schemas) must be planned.
  • Generated files should be committed to source control; set up .gitignore and code generation scripts to ensure team consistency and CI/CD reproducibility.
  • Result mapping uses struct tags and field name matching; ensure generated model struct tags align with your JSON/API serialization requirements or add custom marshaling.
  • Minimum Go 1.24+ required; review compatibility with your Go version policy and upgrade path before adoption.

When to avoid it — and what to weigh

  • Need full ORM features (relationships, eager loading, transactions abstraction) — Jet explicitly is not an ORM. It lacks built-in relationship management, lazy/eager loading patterns, and transaction context helpers. GORM or sqlc may be better fits for complex domain models.
  • Prefer raw SQL files for version control and DBA review — Jet generates SQL at runtime in Go code. Teams that need SQL as versioned artifacts for audit trails or DBA sign-off may prefer tools like migrate or Liquibase paired with traditional query builders.
  • Require dynamic schema introspection or multi-tenant schema switching — Jet code generation happens at build time from a single connected database. Projects requiring runtime schema switching or ad-hoc introspection will need custom wrappers or alternative approaches.
  • Working with heavily legacy databases with irregular naming or undocumented types — Code generation assumes well-formed schemas with clear type mappings. Legacy databases with non-standard naming, custom types, or metadata inconsistencies may require significant manual post-generation fixes.

License & commercial use

Apache License 2.0 (Apache-2.0). Permissive OSI-approved license allowing commercial use, modification, and distribution with minimal restrictions. Requires preservation of license and copyright notices.

Apache-2.0 is a permissive license that explicitly permits commercial use. No proprietary restrictions or commercial licensing fees. Suitable for commercial products. Ensure LICENSE file is included in distributions.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Jet generates parameterized queries using prepared statement placeholders, reducing SQL injection risk. However, security depends on correct use: ensure user input is passed as query parameters, not concatenated into WHERE clauses. Generated code does not enforce this. No external security audit data provided. Review custom generator configuration if modifying generated code output.

Alternatives to consider

sqlc

Similar code generation approach but queries are written in SQL files. Better for teams wanting SQL versioning and DBA review; less idiomatic Go syntax for query building.

GORM

Full ORM with relationship management, hooks, and migrations. More opinionated and heavier; suitable if you need rich domain models but sacrifices the explicit control Jet offers.

ent

Facebook's entity framework for Go with code generation and graph-based schema modeling. Better for complex relational data; steeper learning curve and less SQL-native than Jet.

Software development agency

Build on jet with DEV.co software developers

Jet is production-ready for teams building type-safe microservices and reporting queries in Go. Review the wiki examples, run the code generator against your schema, and assess fit for your database abstraction needs.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

jet FAQ

Does Jet support transactions?
Jet works with standard Go database/sql transaction objects (sql.Tx). You manage transactions using db.BeginTx(); Jet queries are executed within that context. No abstraction layer.
Can I use Jet with an existing Go project?
Yes. Jet generates code alongside existing models; you can adopt Jet incrementally for new queries while keeping legacy code. No migration required for the entire codebase.
What happens when my database schema changes?
Re-run the jet code generator command. Generated files will be overwritten. If you've customized generated code, use -preserve-prefix or -preserve-suffix flags to protect custom additions, or manually merge changes.
Does Jet support database-specific features like PostgreSQL JSONB or window functions?
Yes. Jet's generated builders include database-specific operators and clauses. Window functions, JSONB operators (for PostgreSQL), and JSON_EXTRACT (MySQL) are supported via the generated types.

Software developers & web developers for hire

Need help beyond evaluating jet? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.

Evaluate Jet for Your Go Database Layer

Jet is production-ready for teams building type-safe microservices and reporting queries in Go. Review the wiki examples, run the code generator against your schema, and assess fit for your database abstraction needs.