From c1abe4d61800eba21388e3eac383d107b5a77455 Mon Sep 17 00:00:00 2001
From: Kevin Longe <273747162+kvlonge@users.noreply.github.com>
Date: Fri, 6 Nov 2026 11:03:44 +0000
Subject: [PATCH] docs: pass --builtin-policy where census, function and index
examples need it
Without a sqlquack.toml in the working directory, census, function, index and
convert exit 2. The census example's output is re-run on main c3555dd9 over
jaffle_shop compiled by dbt-snowflake as my_project. The policy page and the
homepage's policy section keep their bare commands: each shows the policy file
it runs with.
---
website/public/index.html | 14 ++++++-------
website/src/content/docs/docs/cli/census.mdx | 20 +++++++++----------
website/src/content/docs/docs/cli/convert.mdx | 2 +-
.../src/content/docs/docs/cli/function.mdx | 2 +-
.../content/docs/docs/cli/index-command.mdx | 2 +-
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/website/public/index.html b/website/public/index.html
index 2f8a9b62b..d9d624aed 100644
--- a/website/public/index.html
+++ b/website/public/index.html
@@ -203,16 +203,16 @@
See what a whole project needs
Point it at a folder of compiled SQL, such as dbt's target/compiled. It counts the constructs, how many convert, and which refusals block the rest.
Run a census →
-sqlquack census target/compiled/my_project/models --schema schema.json
-Census of 3 snowflake SQL files
- parsed 3 (3 statements), unparsed 0, empty 0
- distinct constructs 15 (2 clause, 4 fn, 9 node)
+sqlquack census target/compiled/my_project/models --schema schema.json --builtin-policy
+Census of 25 snowflake SQL files
+ parsed 25 (25 statements), unparsed 0, empty 0
+ distinct constructs 21 (4 clause, 4 fn, 1 join, 12 node)
files refused: missing rule 0, outside type conditions 0, unresolved name 0,
- not expressible 0, parse fidelity 0, conversion budget 0, divergence refused 1
- convertible: strict 2 …, unit-testable 2 …
+ not expressible 0, parse fidelity 0, conversion budget 0, divergence refused 2
+ convertible: strict 23 …, unit-testable 23 …
Refusals by category and construct (top 50)
- 1 a known divergence the policy refuses: fn:HASH
+ 2 a known divergence the policy refuses: fn:SUM
diff --git a/website/src/content/docs/docs/cli/census.mdx b/website/src/content/docs/docs/cli/census.mdx
index 57ce2ecdb..3798cc998 100644
--- a/website/src/content/docs/docs/cli/census.mdx
+++ b/website/src/content/docs/docs/cli/census.mdx
@@ -15,8 +15,8 @@ sqlquack census [OPTIONS]
...
```
```bash
-sqlquack census target/compiled/my_project/models --schema schema.json
-sqlquack census target/compiled --schema schema.json --chain-models --json
+sqlquack census target/compiled/my_project/models --schema schema.json --builtin-policy
+sqlquack census target/compiled --schema schema.json --chain-models --json --builtin-policy
```
Each `.sql` file is one query, or one model compiled by
@@ -26,16 +26,16 @@ recognised. A directory is searched for `.sql` files. Compiled models name relat
they resolve.
```console
-$ sqlquack census target/compiled/my_project/models --schema schema.json
-Census of 3 snowflake SQL files
- parsed 3 (3 statements), unparsed 0, empty 0
- distinct constructs 15 (2 clause, 4 fn, 9 node)
- files refused: missing rule 0, outside type conditions 0, unresolved name 0, not expressible 0, parse fidelity 0, conversion budget 0, divergence refused 1
- convertible: strict 2 (every model upstream converts too), unit-testable 2 (the file's own SQL converts; 0 with an upstream model refused or not scanned)
- with no named assumption: strict 2, unit-testable 2 (relying on one: none)
+$ sqlquack census target/compiled/my_project/models --schema schema.json --builtin-policy
+Census of 25 snowflake SQL files
+ parsed 25 (25 statements), unparsed 0, empty 0
+ distinct constructs 21 (4 clause, 4 fn, 1 join, 12 node)
+ files refused: missing rule 0, outside type conditions 0, unresolved name 0, not expressible 0, parse fidelity 0, conversion budget 0, divergence refused 2
+ convertible: strict 23 (every model upstream converts too), unit-testable 23 (the file's own SQL converts; 0 with an upstream model refused or not scanned)
+ with no named assumption: strict 23, unit-testable 23 (relying on one: none)
Refusals by category and construct (top 50)
- 1 a known divergence the policy refuses: fn:HASH
+ 2 a known divergence the policy refuses: fn:SUM
```
The report holds counts and construct names only, never SQL text or file names. `--names` adds
diff --git a/website/src/content/docs/docs/cli/convert.mdx b/website/src/content/docs/docs/cli/convert.mdx
index 2da414bc7..36710f557 100644
--- a/website/src/content/docs/docs/cli/convert.mdx
+++ b/website/src/content/docs/docs/cli/convert.mdx
@@ -15,7 +15,7 @@ sqlquack convert [OPTIONS] [PATH]
```
```bash
-sqlquack convert query.sql --schema schema.json
+sqlquack convert query.sql --schema schema.json --builtin-policy
echo "SELECT 1 AS total" | sqlquack convert --builtin-policy --json
```
diff --git a/website/src/content/docs/docs/cli/function.mdx b/website/src/content/docs/docs/cli/function.mdx
index 75cc85743..da9380ddf 100644
--- a/website/src/content/docs/docs/cli/function.mdx
+++ b/website/src/content/docs/docs/cli/function.mdx
@@ -15,7 +15,7 @@ sqlquack function --name --schema [OPTIONS]
```
```bash
-sqlquack function --name NET_TOTAL --schema schema.json net_total.sql
+sqlquack function --name NET_TOTAL --schema schema.json --builtin-policy net_total.sql
```
`BODY` is the file holding the function's body: a scalar function's expression, or a table
diff --git a/website/src/content/docs/docs/cli/index-command.mdx b/website/src/content/docs/docs/cli/index-command.mdx
index 78437cf2a..d8b1c734f 100644
--- a/website/src/content/docs/docs/cli/index-command.mdx
+++ b/website/src/content/docs/docs/cli/index-command.mdx
@@ -16,7 +16,7 @@ sqlquack index [OPTIONS] [PATHS]...
```
```bash
-sqlquack index models --schema schema.json --json
+sqlquack index models --schema schema.json --json --builtin-policy
```
Every list is sorted, so the output for two revisions can be diffed to see which files a change to