github neilotoole/sq v0.52.0

8 hours ago

Added

  • 🐥🦆 #437: Beta DuckDB support. The duck
    driver supports most of the DuckDB
    type system; and includes a standard set of in-tree extensions (json,
    parquet, icu, fts, httpfs, excel, inet, autocomplete,
    tpch, tpcds). See the
    driver docs.
  • #498: sq inspect now reports
    foreign keys (fk.outgoing / fk.incoming per table), unique
    constraints, and indexes for every SQL driver (ClickHouse skipped — no
    foreign-key concept). Composite and cross-schema references are
    supported; see the driver-specific caveats in the
    inspect docs.
  • #602: sq now features a
    --render-sql flag, which
    prints the SQL (derived from SLQ input) that would be executed against
    the target database, instead of running it. Honors --format with:
    • text or raw: the rendered SQL is printed.
    • json or yaml: a structured payload is printed containing the
      original SLQ, the rendered SQL, any
      --arg, the
      dialect and information about the sources that the query touches.
      # $ sq --render-sql --yaml '@sakila/pg.actor | join(@sakila/my.film_actor, .actor_id) | .first_name, .last_name, .film_id | .[0:5]'
      slq: "@sakila/pg.actor | join(@sakila/my.film_actor, .actor_id) | .first_name, .last_name, .film_id | .[0:5]"
      sql: SELECT "first_name", "last_name", "film_id" FROM "actor" INNER JOIN "film_actor" ON "actor"."actor_id" = "film_actor"."actor_id" LIMIT 5 OFFSET 0
      dialect: sqlite3
      sources:
        target: "@join_xukcx3ye"
        inputs:
        - "@sakila/pg"
        - "@sakila/my"

Changed

  • ☢️ #499: libsq.SLQ2SQL now returns a structured
    *libsq.RenderResult type instead of string. Any libsq library
    consumers must update call sites; the sq CLI is unaffected.

Don't miss a new sq release

NewReleases is sending notifications on new releases.