Jet is a framework for writing type-safe SQL queries for PostgreSQL in Go, with ability to easily convert database query result to desired arbitrary structure.
*Support for additional databases will be added in future jet releases.
- Auto-generated type-safe SQL Builder
- Types – boolean, integers(smallint, integer, bigint), floats(real, numeric, decimal, double precision), strings(text, character, character varying), date, time(z), timestamp(z) and enums.
- SELECT (DISTINCT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, FOR, UNION, INTERSECT, EXCEPT, sub-queries)
- INSERT (VALUES, query, RETURNING),
- UPDATE (SET, WHERE, RETURNING),
- DELETE (WHERE, RETURNING),
- LOCK (IN, NOWAIT)
- Auto-generated Data Model types – Go types mapped to database type (table or enum), used to store result of database queries. Can be combined to create desired query result destination.
- Query execution with result mapping to arbitrary destination structure.
Generate SQL Builder and Model files
To generate jet SQL Builder and Data Model files from postgres database we need to call
jet generator with postgres connection parameters and root destination folder path for generated files.