jet

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

What is jet?

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

Overview of jet

What it is

Jet is a type-safe SQL builder for Go that includes code generation and automatic query result data mapping. It is not an ORM. Jet currently supports PostgreSQL, MySQL, and SQLite. Databases using compatible wire protocols (e.g., CockroachDB, MariaDB) are also known to work.

Key features

  • Auto-generated type-safe SQL builder supporting SELECT, INSERT, UPDATE, DELETE, LOCK, and WITH statements with clauses such as DISTINCT, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR, UNION, INTERSECT, EXCEPT, WINDOW, sub-queries, ON CONFLICT/ON DUPLICATE KEY UPDATE, RETURNING, and more.
  • Auto-generated Data Model types – Go types mapped to database tables, views, and enums – used to store query results and combinable into complex destinations.
  • Query execution with automatic result mapping to arbitrary Go structures.

Use cases

  • Writing complex, type-safe SQL queries directly in Go code without raw strings.
  • Automatically mapping database query results to Go structs, including nested compositions.
  • Generating Go code from existing database schemas (tables, views, enums) to reduce boilerplate and ensure type safety.

Getting started

Prerequisites: Go version 1.24+ is required. Install Jet as a dependency: sh go get -u github.com/go-jet/jet/v2 Install the Jet generator (option 1): sh go install github.com/go-jet/jet/v2/cmd/jet@latest Or build from source (option 2): sh git clone https://github.com/go-jet/jet.git cd jet && go build -o ./cmd/jet Generate SQL builder and model types from a running database (example with PostgreSQL): sh jet -dsn=postgresql://user:pass@localhost:5432/jetdb?sslmode=disable -schema=dvds -path=./.gen For MySQL, CockroachDB, MariaDB, and SQLite, similar commands are provided in the README.

License and pricing

Jet is open source under the Apache License 2.0. No pricing information is stated.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/go-jetjet.svg)](https://yunodb.com/tools/go-jetjet?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/go-jetjet?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/go-jetjet.svg" alt="Featured on YunoDB" height="20"></a>