Skip to content

v1.1.0 — Named connections + schema introspection

Choose a tag to compare

@ihistand ihistand released this 06 Jun 18:26
· 15 commits to main since this release

Read foreign sources declaratively, without hand-writing FDW boilerplate. Builds on the cross-warehouse Foreign Data Wrappers from 1.0.3.

Highlights

  • Named connections. Define connections: in workflow_settings.yaml (non-secret platform/project/dataset/saKeyId/host defs; secrets stay in .df-credentials.json, keyed by connection name). warehouse: may name a connection. Tag a declaration with connection: and SQLAnvil auto-generates the read-only FDW bridge (BigQuery or Postgres source) — the table becomes ref()-able like any source. connection: is valid only on declarations (tables/views always build into your one read/write warehouse).
  • sqlanvil introspect <connection> <schema.table>. Reads a source table's columns + comments, maps source types to your warehouse dialect (BigQuery → Postgres; Postgres → Postgres), and writes a ready-to-use declaration .sqlx with columnTypes filled in (--output <file> or stdout). Dev-time only — compile/run never touch the network for schema.
  • sqlanvil init now defaults to --warehouse supabase (was bigquery), fitting the Postgres/Supabase-first focus. Pass --warehouse postgres|bigquery to override.

Install

npm install -g @sqlanvil/cli   # 1.1.0

Docs


SQLAnvil is not affiliated with or endorsed by Google. The Dataform name and related marks are trademarks of Google LLC; see NOTICE for attribution.