@sqlanvil/core 1.20.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **SQL workflow tool for BigQuery, Postgres, Supabase, and MySQL/MariaDB.**
4
4
 
5
- SQLAnvil is an open-source fork of [Dataform OSS](https://github.com/dataform-co/dataform) (Apache 2.0), extended with first-class PostgreSQL and Supabase support, plus adapters for other data sources. Define your data transformations in SQLX, have SQLAnvil compile them to idiomatic SQL, and run them against your warehouse.
5
+ SQLAnvil is an open-source fork of [Dataform OSS](https://github.com/dataform-co/dataform) (Apache 2.0), extended with first-class PostgreSQL, Supabase, and MySQL/MariaDB support. Define your data transformations in SQLX, have SQLAnvil compile them to idiomatic SQL for your warehouse, and run, validate, and document the whole DAG from one CLI.
6
6
 
7
7
  > **SQLAnvil is not affiliated with or endorsed by Google.** The Dataform name and related marks are trademarks of Google LLC. See [NOTICE](NOTICE) for attribution.
8
8
 
@@ -10,10 +10,21 @@ SQLAnvil is an open-source fork of [Dataform OSS](https://github.com/dataform-co
10
10
 
11
11
  ## Features
12
12
 
13
- - **BigQuery** — full support: partitioning, clustering, labels, materialized views, `MERGE`-based incremental upserts
14
- - **PostgreSQL** — idiomatic DDL: native partitioning, `INSERT ... ON CONFLICT` upserts, btree/gin/gist/brin indexes, tablespaces, fillfactor
15
- - **Supabase** — extends Postgres with RLS policies, Realtime publications, pgvector indexes, and Supabase Wrappers _(coming soon)_
16
- - **MySQL / MariaDB** — portable MySQL DDL: CTAS tables, `CREATE OR REPLACE VIEW`, `ON DUPLICATE KEY UPDATE` incremental upserts (one adapter, validated against both engines)
13
+ **Four first-class warehouses** — each adapter generates its warehouse's own idiomatic SQL, not translated BigQuery:
14
+
15
+ - **PostgreSQL** — native partitioning (RANGE/LIST/HASH), `INSERT … ON CONFLICT` upserts, btree/hash/gin/gist/brin indexes (unique, partial, `INCLUDE`, opclasses), tablespaces, fillfactor, materialized views with in-place refresh policies
16
+ - **Supabase** — everything Postgres, plus RLS policies, Realtime publications, pgvector indexes, and Supabase Wrappers (FDW) as declarative actions
17
+ - **MySQL / MariaDB** — one adapter validated against both engines: CTAS tables, `ON DUPLICATE KEY UPDATE` incremental upserts, the full `mysql: {}` config block (engine/charset/collation/rowFormat, secondary indexes incl. `FULLTEXT`/`SPATIAL` and prefix lengths, native partitioning), materialized-view emulation
18
+ - **BigQuery** — full upstream support: partitioning, clustering, labels, materialized views, `MERGE`-based incremental upserts
19
+
20
+ **Beyond transformation** — the pieces most SQL workflow tools leave outside the pipeline:
21
+
22
+ - **Cross-warehouse sources** — read BigQuery or MySQL/MariaDB from a Postgres/Supabase warehouse via named `connections:`: a live FDW bridge (Supabase Wrappers) or **runner-extract** (the CLI reads the source at run time and materializes a plain `ref()`-able table — keyless BigQuery supported). `sqlanvil introspect` scaffolds the declarations
23
+ - **File imports & exports** — `type: "import"` loads Parquet/CSV/JSON from `s3://`/`gs://`/local into a `ref()`-able table (DuckDB bridge on Postgres/Supabase, native `LOAD DATA` on BigQuery); `type: "export"` writes query results back out to files
24
+ - **Python script actions** — `python:` in `actions.yaml` runs file-staging and glue scripts as first-class DAG nodes: ordered by dependencies, covered by run history, no warehouse credentials injected (scripts stage files; `import` loads them). SQLAnvil validates the declared environment — interpreter version, `requirements.txt` vs installed packages, syntax — and never installs anything
25
+ - **`sqlanvil validate`** — EXPLAIN/dry-run the *whole DAG* against the live warehouse without executing: an isolated shadow schema of empty stubs lets every downstream `ref()` resolve; results classify as PASS / FAIL / BLOCKED so one real error doesn't cascade
26
+ - **Queryable artifacts** — every compile/run writes a Parquet catalog + run history under `target/`; `sqlanvil query` runs SQL over them, `sqlanvil inspect` summarizes, `sqlanvil docs` renders a self-contained HTML catalog
27
+ - **Release-artifact runs** — `sqlanvil run --graph <file>` executes a stored `compile --json` output exactly as compiled; **named environments** (`--environment`) give per-env schema suffixes and vars
17
28
  - **SQLX + YAML + JS** — three authoring modes: SQL with config blocks, `actions.yaml` bulk definitions, or the JavaScript API
18
29
 
19
30
  ---
@@ -24,23 +35,32 @@ SQLAnvil is an open-source fork of [Dataform OSS](https://github.com/dataform-co
24
35
  npm install -g @sqlanvil/cli
25
36
  sqlanvil init my-project
26
37
  cd my-project
27
- # edit workflow_settings.yaml to configure your warehouse
38
+ # edit workflow_settings.yaml + .df-credentials.json (see below)
28
39
  sqlanvil compile
29
40
  sqlanvil run
30
41
  ```
31
42
 
32
- **`workflow_settings.yaml` example (Postgres):**
43
+ **`workflow_settings.yaml` (Postgres/Supabase):** the warehouse is a flat string; connection
44
+ secrets never live here.
33
45
 
34
46
  ```yaml
35
- warehouse:
36
- kind: postgres
37
- host: localhost
38
- port: 5432
39
- database: analytics
40
- user: sqlanvil_writer
41
- password: ${PG_PASSWORD}
42
- ssl: disable
43
- defaultSchema: public
47
+ warehouse: postgres # bigquery | postgres | supabase | mysql
48
+ defaultDataset: public # the Postgres schema
49
+ defaultAssertionDataset: sqlanvil_assertions
50
+ sqlanvilCoreVersion: 1.20.1
51
+ ```
52
+
53
+ **`.df-credentials.json`** (gitignored) holds the connection:
54
+
55
+ ```json
56
+ {
57
+ "host": "localhost",
58
+ "port": 5432,
59
+ "database": "analytics",
60
+ "user": "sqlanvil_writer",
61
+ "password": "...",
62
+ "sslMode": "disable"
63
+ }
44
64
  ```
45
65
 
46
66
  **First action (`definitions/my_view.sqlx`):**
@@ -58,23 +78,29 @@ SELECT 1 AS id, 'hello' AS greeting
58
78
 
59
79
  ## Documentation
60
80
 
61
- Full documentation at **[sqlanvil.com](https://sqlanvil.com)**.
81
+ Full documentation at **[sqlanvil.com/docs](https://sqlanvil.com/docs/)**.
82
+
83
+ - [Getting Started](https://sqlanvil.com/docs/getting-started/)
84
+ - Warehouses: [PostgreSQL](https://sqlanvil.com/docs/guides/postgres/) · [Supabase](https://sqlanvil.com/docs/guides/supabase/) · [MySQL/MariaDB](https://sqlanvil.com/docs/guides/mysql/) · [BigQuery](https://sqlanvil.com/docs/guides/bigquery/)
85
+ - [Cross-warehouse sources](https://sqlanvil.com/docs/guides/foreign-wrappers/) · [File Imports](https://sqlanvil.com/docs/guides/imports/) · [File Exports](https://sqlanvil.com/docs/guides/exports/) · [Python Script Actions](https://sqlanvil.com/docs/guides/python-actions/)
86
+ - [Validate](https://sqlanvil.com/docs/guides/validate/) · [Named Environments](https://sqlanvil.com/docs/guides/environments/) · [Artifacts & Catalog](https://sqlanvil.com/docs/guides/artifacts/)
87
+ - [Configs Reference](https://sqlanvil.com/docs/reference/configs/) · [What's New](https://sqlanvil.com/docs/whats-new/)
62
88
 
63
- - [Getting Started](https://sqlanvil.com/getting-started/)
64
- - [BigQuery Guide](https://sqlanvil.com/guides/bigquery/)
65
- - [PostgreSQL Guide](https://sqlanvil.com/guides/postgres/)
66
- - [Supabase Guide](https://sqlanvil.com/guides/supabase/)
67
- - [Configs Reference](https://sqlanvil.com/reference/configs/)
89
+ Writing sqlanvil projects with an AI agent? Point it at [`AGENTS.md`](AGENTS.md) — it corrects
90
+ the Dataform/BigQuery priors that otherwise produce broken sqlanvil code. Contributor/design
91
+ docs live in the separate [`sqlanvil/docs`](https://github.com/sqlanvil/docs) repo.
68
92
 
69
93
  ---
70
94
 
71
95
  ## Project layout
72
96
 
73
97
  ```
74
- core/ Compiler + action types (table/view/incremental/assertion/operation/notebook/declaration)
75
- cli/ CLI entrypoint and per-adapter glue (cli/api/dbadapters/)
98
+ core/ Compiler + action types (table/view/incremental/assertion/operation/declaration/import/export/script/…)
99
+ cli/ CLI entrypoint and per-adapter glue (cli/api/dbadapters/ — bigquery, postgres, supabase, mysql)
76
100
  protos/ Protobuf definitions for core/configs/execution/db_adapter
77
- examples/ Sample SQLAnvil projects
101
+ tests/ Integration specs against real warehouses (Postgres, Supabase, MySQL/MariaDB, BigQuery)
102
+ tools/ Bazel rules + Docker fixtures for the integration databases
103
+ examples/ Sample SQLAnvil projects (see examples/supabase_bigquery_mailing_list)
78
104
  scripts/ ./scripts/run is the CLI entrypoint wrapper
79
105
  ```
80
106
 
@@ -82,28 +108,22 @@ scripts/ ./scripts/run is the CLI entrypoint wrapper
82
108
 
83
109
  ## Building from source
84
110
 
85
- SQLAnvil uses [Bazel](https://bazel.build) (via Bazelisk). Native Bazel works on macOS
86
- and Linux (Bazel 7 + bzlmod):
111
+ SQLAnvil uses [Bazel](https://bazel.build) 7 with bzlmod (via Bazelisk). Native Bazel works on
112
+ macOS and Linux:
87
113
 
88
114
  ```bash
89
- # Build the proto layer
90
- bazel build //protos:sqlanvil_proto
91
-
92
115
  # Run the CLI
93
116
  ./scripts/run help
94
117
 
95
118
  # Run tests
96
119
  bazel test //core/... //cli/...
97
- ```
98
120
 
99
- A Docker-based build container (`./scripts/docker-bazel`) remains available as an
100
- optional hermetic environment. See [contributing.md](contributing.md) for full instructions.
101
-
102
- ---
103
-
104
- ## Documentation
121
+ # Integration tests against a local Docker Postgres
122
+ ./tools/postgres/run-postgres-db.sh
123
+ ```
105
124
 
106
- Reference docs and design documents live in the separate [`sqlanvil/docs`](https://github.com/sqlanvil/docs) repo, published at [sqlanvil.com/docs](https://sqlanvil.com/docs/).
125
+ A Docker-based build container (`./scripts/docker-bazel`) remains available as an optional
126
+ hermetic environment. See [contributing.md](contributing.md) for full instructions.
107
127
 
108
128
  ---
109
129
 
@@ -111,4 +131,4 @@ Reference docs and design documents live in the separate [`sqlanvil/docs`](https
111
131
 
112
132
  Apache License 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
113
133
 
114
- SQLAnvil is a derivative of Dataform OSS (originally developed by Dataform Co and contributed to by Google LLC). It has been fully renamed and extended with first-class PostgreSQL/Supabase support. Licensed under Apache License 2.0.
134
+ SQLAnvil is a derivative of Dataform OSS (originally developed by Dataform Co and contributed to by Google LLC). It has been fully renamed and extended with first-class PostgreSQL/Supabase/MySQL support. Licensed under Apache License 2.0.
package/bundle.d.ts CHANGED
@@ -16813,7 +16813,7 @@ declare function jitCompiler(rpcCallback: RpcCallback): IJitCompiler;
16813
16813
 
16814
16814
  declare function main(coreExecutionRequest: Uint8Array | string): Uint8Array | string;
16815
16815
 
16816
- declare const version = "1.20.0";
16816
+ declare const version = "1.21.0";
16817
16817
 
16818
16818
  declare const session: Session;
16819
16819
  declare const supportedFeatures: sqlanvil.SupportedFeatures[];