Skip to content

Releases: nao1215/sqlode

v0.1.0

17 Apr 15:19
5c0337e

Choose a tag to compare

Added

  • Initial sqlc-style code generator for Gleam
  • PostgreSQL, MySQL, and SQLite engine support
  • Query annotations :one, :many, :exec, :execresult, :execrows, :execlastid supported end-to-end. :batchone, :batchmany, :batchexec, and :copyfrom are parsed for sqlc compatibility but currently fail generation with an unsupported-annotation error.
  • sqlode macros: sqlode.arg, sqlode.narg, sqlode.slice, sqlode.embed
  • Type mapping for INT, FLOAT, BOOL, TEXT, BYTEA, UUID, JSON, TIMESTAMP, DATE, TIME
  • PostgreSQL ENUM type support
  • Nullable column detection with Option(T) wrapping
  • Result record types (models.gleam) for :one and :many queries
  • Adapter generation for pog (PostgreSQL) and sqlight (SQLite)
  • RETURNING clause support for INSERT/UPDATE/DELETE
  • CTE (WITH clause) support
  • JOIN type inference
  • Type overrides and column renames via config
  • init command with stub db/schema.sql and db/query.sql creation
  • generate command with --config flag
  • Version constant in version.gleam as single source of truth

Install

Download the sqlode escript below and place it on your PATH.
Requires Erlang/OTP runtime.

chmod +x sqlode
./sqlode generate --config=sqlode.yaml