You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d159d0a
Browse filesBrowse the repository at this point in the historyBrowse files
docs: reorganise the docs around what a user is doing and rewrite pages that bury their point (#1435)
* docs: make Refactoring the style exemplar and add opening and one-rule guidance
* docs: regroup the sidebar by task and lead naming and column-migration pages with the normal path
* docs: split testing, SQL macro and Recall reference pages and add project setup
* docs: lead model migrations and sqb rename with the normal path
* docs: remove history notes, engine names and adapter internals from user pages
* docs: trim implementation detail from format, test, freshness, observability and scope pages
* docs: remove duplicated sections and retitle compile, variables and observability pages
* docs: label ambiguous sidebar entries, trim janitor and header-string detail, and regenerate the docs skill
* docs: correct promotion, incremental failure, Snowflake metadata and rename-detection wording
* docs: say Snowflake source probes may need a running warehouse
* docs: draft contracts, reusable schemas, compile and configuration pages for check_declared_columns
* docs: address follow-up review of contracts, schemas, configuration and build limits
* docs: narrow schema-change and immediate-promotion wording on contracts and schemas
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/audit.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Positional `SELECTOR` arguments work like `--select`, and both forms can be comb
29
29
|`--concurrency`| Maximum number of audits to run concurrently (default: `1`) |
30
30
|`--json`| Print structured audit results |
31
31
|`--json-output`| Write structured audit results to a file |
32
-
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/project-configuration.md#command-group-warehouses) and the connection warehouse |
32
+
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/adapters/snowflake.md#command-group-warehouses) and the connection warehouse |
@@ -61,7 +62,7 @@ own option. `--version` works only directly after `sqb`, as in `sqb --version`:
61
62
|`--defer-sources-to`| Read managed source data from another target |
62
63
|`--fail-fast`| Stop on first failure and skip remaining nodes |
63
64
|`--concurrency`| Number of worker connections (default: 1) |
64
-
|`--test-timeout <duration>`| Time limit for each unit test the build runs, such as `30s`, or `disabled`; see [Time limits](../concepts/testing.md#time-limits)|
65
+
|`--test-timeout <duration>`| Time limit for each unit test the build runs, such as `30s`, or `disabled`; see [Time limits](../concepts/testing-reference.md#time-limits)|
65
66
|`--verbose`, `-v`| Show lifecycle SQL inline after each model |
66
67
|`--start-cursor`| Override the start cursor, typed from the selected incremental models' cursor type; fails with `S303` if the selection mixes timestamp and integer cursors. With no cursor model selected, an integer value is read as an integer cursor and anything else as an ISO timestamp |
67
68
|`--end-cursor`| Override the end cursor, typed the same way as `--start-cursor`|
@@ -77,7 +78,7 @@ own option. `--version` works only directly after `sqb`, as in `sqb --version`:
77
78
|`SELECTOR ...`| Positional selectors, the same as `--select`|
78
79
|`--select`, `-s`| Select specific models, or unit tests by name (`test:<name>`); selecting only unit tests runs them without building models |
79
80
|`--exclude`| Exclude specific models |
80
-
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/project-configuration.md#command-group-warehouses) and the connection warehouse |
81
+
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/adapters/snowflake.md#command-group-warehouses) and the connection warehouse |
81
82
82
83
## Fast iteration
83
84
@@ -219,6 +220,58 @@ skipped as for any other failure. Its row shows `TIMEOUT`. In the summary line,
219
220
failures were timeouts. A timeout is a failure for the exit code: the build exits non-zero and its
220
221
JSON `status` is `failed`.
221
222
223
+
## Limits
224
+
225
+
A target's [`execution_limits`](../concepts/project-configuration.md#execution-limits) cap a whole
226
+
build, and a model's [`max_duration`](../concepts/models/configuration.md#execution-time-limit) caps
227
+
one model.
228
+
229
+
### Model limit
230
+
231
+
When the build would run more models than `max_models`, the build stops before any clone, load or
232
+
model runs, and says that nothing in the warehouse changed. `sqb plan` has no limit, so use it to
233
+
check a broad selection.
234
+
235
+
### Duration limit
236
+
237
+
`max_duration` covers planning and the build. At the deadline SQLBuild starts no more work and
238
+
cancels the statements still running. Where the warehouse has a statement time limit, each
239
+
statement also gets only the time that remains.
240
+
241
+
| Adapter | Warehouse statement limit | Cancellation at the deadline | Longest accepted duration |
| Snowflake |`STATEMENT_TIMEOUT_IN_SECONDS` per statement | Driver cancel request for the running query | 7 days |
244
+
| DuckDB, MotherDuck | None | Connection interrupt | About 24 days |
245
+
| PostgreSQL |`SET LOCAL statement_timeout` inside transactions; statements outside a transaction rely on cancellation | Driver cancel (`cancel_safe`) | About 24 days |
246
+
| BigQuery | Job timeout (`job_timeout_ms`) on each query job |`jobs.cancel`; reported as requested, not confirmed | About 24 days |
247
+
| Databricks |`STATEMENT_TIMEOUT` session setting, capped at 48 hours | Cursor cancel; reported as requested, not confirmed | About 24 days |
248
+
| SQL Server | None; the driver's query timeout is process-wide | Driver cancel | About 24 days |
249
+
| SQLite | None | Connection interrupt | About 24 days |
250
+
251
+
A duration timeout can come after earlier models finished, so its error says that warehouse changes
252
+
may already have been made. A custom adapter that can't cancel a running statement can't be used
253
+
with `max_duration`.
254
+
255
+
### Per-item time limits
256
+
257
+
Unit test, scenario and model limits (`test_timeout`, `scenario_timeout` and a model's
258
+
`max_duration`) count running time only, from the item's first warehouse statement. Rollback and
259
+
cleanup always run and don't count. Where a warehouse reports queueing separately, queued
260
+
time doesn't count:
261
+
262
+
| Adapter | How the item limit is enforced | Queued time |
| Snowflake |`STATEMENT_TIMEOUT_IN_SECONDS` per statement, with a client-side backstop after a grace margin of half the limit (at least 30 seconds) | Excluded by the warehouse limit; the backstop counts it |
265
+
| DuckDB, MotherDuck | Connection interrupt at the limit | Not applicable |
266
+
| PostgreSQL |`SET LOCAL statement_timeout` inside transactions; cancellation at the limit | Lock waits count |
267
+
| BigQuery |`jobs.cancel` at the limit; no job timeout, because a job timeout counts from job creation | Excluded: the clock stops while a job is pending |
268
+
| Databricks |`STATEMENT_TIMEOUT` session setting and cursor cancel | May count |
269
+
| SQL Server | Driver cancel at the limit | Lock waits count |
270
+
| SQLite | Connection interrupt at the limit | Waits for the write lock count |
271
+
272
+
When limits nest, such as a model's unit tests inside its own limit, the earliest deadline applies.
273
+
After a timeout, SQLBuild checks the connection and replaces it if it is no longer usable.
274
+
222
275
## Fingerprints
223
276
224
277
After a successful build, SQLBuild writes version identities to `_sqlbuild_fingerprints` in the target schema. These are used on subsequent runs to detect changes and skip unchanged work. A build writes a row only for a resource whose identity differs from its latest row, so a build that changes no definitions writes none. In a project with model migration history, every build writes a row for each resource it builds. See [Planning and Change Detection](../concepts/planning.md) for details.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/check.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Positional `SELECTOR` arguments work like `--select`, and both forms can be comb
27
27
|`--json`| Print check results as JSON |
28
28
|`--json-output`| Write check results JSON to a file path |
29
29
|`--vars`| Override project variables |
30
-
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/project-configuration.md#command-group-warehouses) and the connection warehouse |
30
+
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/adapters/snowflake.md#command-group-warehouses) and the connection warehouse |
31
31
32
32
Selecting a non-check node is rejected; use [`sqb build`](build.md) to run tasks and assets.
|`--hard-copy`| Force physical table copies instead of zero-copy cloning |
45
45
|`--select`, `-s`| Select specific models to clone |
46
46
|`--exclude`| Exclude specific models from cloning |
47
-
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/project-configuration.md#command-group-warehouses) and the connection warehouse |
47
+
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `build`[warehouse group](../concepts/adapters/snowflake.md#command-group-warehouses) and the connection warehouse |
|`--warehouse <name>`| both | Snowflake warehouse for this invocation; overrides the target's `query`[warehouse group](../concepts/project-configuration.md#command-group-warehouses) and the connection warehouse |
56
+
|`--warehouse <name>`| both | Snowflake warehouse for this invocation; overrides the target's `query`[warehouse group](../concepts/adapters/snowflake.md#command-group-warehouses) and the connection warehouse |
41
57
42
-
See [Contracts](../concepts/models/contracts.md#adopting-an-existing-schema) for ownership and safety
43
-
guarantees.
58
+
Sources can be selected like models, for example `--select source:raw_orders`. See
59
+
[Contracts](../concepts/models/contracts.md) for what a contract checks.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/dbt.md
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,16 @@
6
6
7
7
Online: https://sqlbuild.com/docs/cli/dbt/
8
8
9
+
## Contents
10
+
11
+
- sqb dbt plan
12
+
- sqb dbt run
13
+
- sqb dbt build
14
+
- Flags
15
+
- sqb dbt debug
16
+
- Selectors
17
+
- Configuration
18
+
9
19
Orchestrate dbt and SQLBuild together. Each subcommand runs dbt first, then SQLBuild, with selection logic across both project graphs. dbt remains responsible for dbt-owned models; SQLBuild validates and executes SQLBuild-owned models downstream. See [Using SQLBuild with dbt](../concepts/dbt-compatibility/overview.md) for scope and selection behavior.
10
20
11
21
## sqb dbt plan
@@ -48,6 +58,40 @@ confirmation asks for the typed confirmation on an interactive terminal and refu
48
58
build the affected models with `sqb build` and its allow flag instead, or relax the policy. A
49
59
refusal at this point leaves completed dbt work in place and builds no SQLBuild models.
50
60
61
+
## Flags
62
+
63
+
`sqb dbt plan/run/build` declare the common flags directly. Anything declared goes **before** a `--` separator; any other raw dbt flag goes **after** it and is forwarded verbatim. A flag placed on the wrong side errors rather than silently reaching dbt.
|`--vars`| dbt **and** SQLBuild | The same vars feed dbt's compile and SQLBuild's own variable resolution, so both sides see identical values. |
75
+
|`--full-refresh`| dbt **and** SQLBuild | Requests a full rebuild on both sides. dbt and native SQLBuild models independently apply their model-level `full_refresh` setting, including `false` opt-outs. |
76
+
|`--threads`| dbt (`--threads`) and SQLBuild (`--concurrency`) ||
`--vars` accepts the same JSON object dbt accepts, and SQLBuild passes it to **both** the underlying `dbt` invocation and its own variable resolution. That means a value referenced as `@@my_var` in SQLBuild model SQL (see [Variables and placeholders](../concepts/interpolation.md)) and as `{{ var('my_var') }}` in a dbt model both resolve to the value you passed. CLI vars take precedence over project and local config vars. You do not need to declare vars twice.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/debug.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
<!-- generated-by: sqlbuild skills -->
2
2
3
-
# debug
3
+
# sqb debug
4
4
5
5
> Validate project configuration and test the warehouse connection.
6
6
@@ -22,7 +22,7 @@ The command reports four groups of checks:
22
22
23
23
**Runtime** - SQLBuild version, Python version, Python path, OS info.
24
24
25
-
**Configuration** - Finds and validates `sqlbuild_project.toml`, loads `sqlbuild_local.toml` if present, resolves the adapter, active target, connection, database, and schema. For Snowflake it also shows the warehouse each [command group](../concepts/project-configuration.md#command-group-warehouses) connects with and where that value came from.
25
+
**Configuration** - Finds and validates `sqlbuild_project.toml`, loads `sqlbuild_local.toml` if present, resolves the adapter, active target, connection, database, and schema. For Snowflake it also shows the warehouse each [command group](../concepts/adapters/snowflake.md#command-group-warehouses) connects with and where that value came from.
26
26
27
27
**Providers** - Lists the [providers](../concepts/python-nodes/providers.md) the project defines.
28
28
@@ -34,7 +34,7 @@ The command reports four groups of checks:
34
34
|------|-------------|
35
35
|`--no-connection`| Skip the connection and query tests. Useful for validating config without warehouse access. |
36
36
|`--json`| Output results as JSON instead of formatted text. |
37
-
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `query`[warehouse group](../concepts/project-configuration.md#command-group-warehouses) and the connection warehouse |
37
+
|`--warehouse <name>`| Snowflake warehouse for this invocation; overrides the target's `query`[warehouse group](../concepts/adapters/snowflake.md#command-group-warehouses) and the connection warehouse |
0 commit comments