jet

command
v0.0.0-...-78dbd8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Build and run some queries using the Jet generator library. Jet is a type-safe SQL builder, that also generates models of your existing db schema, and can scan directly to those models. Jet works by connecting to your database and inspecting the schema, in order to generate models. This allows its SQL builder to be both type safe and use the actual column names defined in your database schema. Some disadvantages of it are:

  • the default schema assumes all postgres arrays and json/jsonb types become golang strings. This apparently can be customized though.
  • the sql builder can be a bit cumbersome and verbose, owing to its type safety.
  • the sql builder requires wrappers to support slices.
  • the sql scanner does not work with PGX. Jet's SQL Builder works with both database/sql and PGX, but the scanner only works with database/sql.
  • if using just the sql builder with PGX, you can not use the generated models if they contain any arrays.
  • A very minor disadvantage is that it doesn't use postgres' =ANY($1) format for IN queries using a slice, and instead enumerates all values in the slice.

Directories

Path Synopsis
internal
Build and run some queries using the Jet generator library.
Build and run some queries using the Jet generator library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL