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 677bb88
Browse filesBrowse the repository at this point in the historyBrowse files
feat: shorter CLI forms for selection, global flags, JSON output, scope targets and cursors
Accept --project-dir, --no-color and --debug after the subcommand as well as
before it. Treat positional arguments to compile, plan, build, test, seed,
freshness, audit and check as selectors, combined with any --select values.
Add --json as shorthand for --format json on lineage and query. Let sqb scope
take bare model, source, seed and function names, resolved with the shared
target resolver; macros, enums, constants, tests and audits keep their prefix
and fail with C960 when written bare. Add --start-cursor and --end-cursor to
build, plan and load, typed from the selected models' cursor type; a
selection mixing timestamp and integer cursors fails with S303. The -ts and
-int flags keep working.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/audit.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,18 @@ Runs all attached audits without rebuilding models. Useful for verifying data qu
11
11
## Usage
12
12
13
13
```bash
14
-
sqb --project-dir <path> audit [flags]
14
+
sqb audit [SELECTOR ...] [flags]
15
15
```
16
16
17
+
Positional `SELECTOR` arguments work like `--select`, and both forms can be combined. `--project-dir <path>`, `--no-color`, and `--debug` can go before or after the command name.
18
+
17
19
## Flags
18
20
19
21
| Flag | Description |
20
22
|------|-------------|
21
23
|`--no-sql-analysis`| Disable compile-time SQL analysis (`--no-sql-validation` is an alias) |
22
24
|`--defer-to`| Resolve model references against another target |
25
+
|`SELECTOR ...`| Positional selectors, the same as `--select`|
23
26
|`--select`, `-s`| Select audits attached to specific models |
24
27
|`--select-file`| Read selectors from a file |
25
28
|`--exclude`| Exclude audits attached to specific models |
@@ -62,7 +65,7 @@ guarantee immediate cancellation of a query already running in the warehouse.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/build.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,17 @@ Compiles, plans, and executes the selected build lifecycle, running the full sel
25
25
## Usage
26
26
27
27
```bash
28
-
sqb --project-dir <path> build [flags]
28
+
sqb build [SELECTOR ...] [flags]
29
29
```
30
30
31
+
Positional `SELECTOR` arguments work like `--select`, and both forms can be combined.
32
+
31
33
## Global options
32
34
33
-
These options apply to every `sqb` command and go before the command name, as in
34
-
`sqb --debug build`:
35
+
These options apply to every `sqb` command. `--project-dir`, `--no-color`, and `--debug` go
36
+
before or after the command name, as in `sqb --debug build` or `sqb build --debug`. Under
37
+
`sqb dbt`, put `--project-dir` before `dbt`: after it, `--project-dir` is passed to dbt as dbt's
38
+
own option. `--version` works only directly after `sqb`, as in `sqb --version`:
35
39
36
40
| Option | Description |
37
41
|--------|-------------|
@@ -56,6 +60,8 @@ These options apply to every `sqb` command and go before the command name, as in
56
60
|`--fail-fast`| Stop on first failure and skip remaining nodes |
57
61
|`--concurrency`| Number of worker connections (default: 1) |
58
62
|`--verbose`, `-v`| Show lifecycle SQL inline after each model |
63
+
|`--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 |
64
+
|`--end-cursor`| Override the end cursor, typed the same way as `--start-cursor`|
59
65
|`--start-cursor-ts`| Override start cursor for timestamp incremental models (ISO format) |
60
66
|`--end-cursor-ts`| Override end cursor for timestamp incremental models (ISO format) |
61
67
|`--start-cursor-int`| Override start cursor for integer incremental models |
@@ -65,6 +71,7 @@ These options apply to every `sqb` command and go before the command name, as in
65
71
|`--reload`| Reload managed sources (passes `is_reload=True` to loaders) |
66
72
|`--selection-diagnostics`| Warn when a selected model will build on changed upstream models that are not selected; see [Selection and staleness](../concepts/planning/selection-and-staleness.md)|
67
73
|`--manifest`| Generate `target/manifest.json` with plan-aware project metadata |
74
+
|`SELECTOR ...`| Positional selectors, the same as `--select`|
68
75
|`--select`, `-s`| Select specific models |
69
76
|`--exclude`| Exclude specific models |
70
77
|`--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 |
@@ -132,7 +139,7 @@ statement or step still prints its `FAIL` row.
132
139
Use `--defer-to` to resolve unselected model references against another target. This lets you build a subset of models in dev while referencing production tables for everything else:
133
140
134
141
```bash
135
-
sqb build --select fact_orders --defer-to prod
142
+
sqb build fact_orders --defer-to prod
136
143
```
137
144
138
145
No `manifest.json` is required. `--defer-to` selects only the namespace used for unselected
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/check.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,16 @@ Runs Python [checks](../concepts/python-nodes/checks.md) in isolation. Checks va
11
11
## Usage
12
12
13
13
```bash
14
-
sqb --project-dir <path> check [flags]
14
+
sqb check [SELECTOR ...] [flags]
15
15
```
16
16
17
+
Positional `SELECTOR` arguments work like `--select`, and both forms can be combined. `--project-dir <path>`, `--no-color`, and `--debug` can go before or after the command name.
18
+
17
19
## Flags
18
20
19
21
| Flag | Description |
20
22
|------|-------------|
23
+
|`SELECTOR ...`| Positional selectors, the same as `--select`|
21
24
|`--select`, `-s`| Select checks to run (by name, `check:`, `tag:`, or graph expansion) |
22
25
|`--exclude`| Exclude checks from the selection |
23
26
|`--no-sql-analysis`| Disable compile-time SQL analysis (`--no-sql-validation` is an alias) |
@@ -35,10 +38,10 @@ Selecting a non-check node is rejected; use [`sqb build`](build.md) to run tasks
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/compile.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,9 +23,11 @@ Discovers the complete project, resolves references, expands macros, validates S
23
23
## Usage
24
24
25
25
```bash
26
-
sqb --project-dir <path> compile [flags]
26
+
sqb compile [SELECTOR ...] [flags]
27
27
```
28
28
29
+
Positional `SELECTOR` arguments work like `--select`, and both forms can be combined. `--project-dir <path>`, `--no-color`, and `--debug` can go before or after the command name.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/freshness.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,11 @@ Observes the current data version of each source and reports whether the data ha
22
22
## Usage
23
23
24
24
```bash
25
-
sqb --project-dir <path> freshness [flags]
25
+
sqb freshness [SELECTOR ...] [flags]
26
26
```
27
27
28
+
Positional `SELECTOR` arguments work like `--select`, and both forms can be combined. `--project-dir <path>`, `--no-color`, and `--debug` can go before or after the command name.
|`--json`| Output as JSON instead of human-readable text |
36
38
|`--json-output`| Write JSON output to a file path (also prints text to stdout unless `--json` is set) |
37
39
|`--no-sql-analysis`| Disable compile-time SQL analysis (`--no-sql-validation` is an alias) |
40
+
|`SELECTOR ...`| Positional selectors, the same as `--select`|
38
41
|`--select`, `-s`| Select specific sources or models (sources upstream of selected models are included) |
39
42
|`--exclude`| Exclude specific sources or models |
40
43
|`--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 |
@@ -48,10 +51,10 @@ Without `--select`, all sources in the project are observed. When `--select` is
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/lineage.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ Exactly one of a positional target or `--select` is required.
41
41
|`--direction`|`upstream` (default), `downstream`, or `both`. `both` is only available for model lineage. |
42
42
|`--depth`| How many hops to traverse. An integer or `all` (default: `all`). |
43
43
|`--format`| Output format: `tree` (default), `list`, or `json`. |
44
+
|`--json`| Shorthand for `--format json`. |
44
45
|`--mode`| Column lineage analysis mode: `rich` (default) or `fast`. |
45
46
|`--no-sql-analysis`| Disable compile-time SQL analysis (`--no-sql-validation` is an alias). |
46
47
|`--select`, `-s`| Select resources using the same selector syntax as `sqb compile`, `sqb plan` and `sqb build`, for example `path:models/marts`, `tag:finance` or `stg_*`. |
|`--exclude`| Exclude specific sources or loaders |
23
23
|`--reload`| Pass `is_reload=True` to loader functions |
24
24
|`--concurrency`| Number of worker connections (default: from settings or 1) |
25
+
|`--start-cursor`| Override the start cursor; an integer value sets `start_cursor_int`, anything else is read as an ISO timestamp and sets `start_cursor_ts`|
26
+
|`--end-cursor`| Override the end cursor, typed the same way as `--start-cursor`|
25
27
|`--start-cursor-ts`| Override start cursor for timestamp-based loaders (ISO format) |
26
28
|`--end-cursor-ts`| Override end cursor for timestamp-based loaders (ISO format) |
27
29
|`--start-cursor-int`| Override start cursor for integer-based loaders |
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/plan.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,11 @@ Shows the execution plan without making any changes. Useful for inspecting chang
19
19
## Usage
20
20
21
21
```bash
22
-
sqb --project-dir <path> plan [flags]
22
+
sqb plan [SELECTOR ...] [flags]
23
23
```
24
24
25
+
Positional `SELECTOR` arguments work like `--select`, and both forms can be combined. `--project-dir <path>`, `--no-color`, and `--debug` can go before or after the command name.
26
+
25
27
## Flags
26
28
27
29
| Flag | Description |
@@ -34,10 +36,13 @@ sqb --project-dir <path> plan [flags]
34
36
|`--json`| Output the plan as JSON |
35
37
|`--selection-diagnostics`| Warn when a selected model will build on changed upstream models that are not selected; see [Selection and staleness](../concepts/planning/selection-and-staleness.md)|
36
38
|`--full-refresh`| Plan a full rebuild for selected models unless a model sets `full_refresh false`; `full_refresh true` forces a model without this flag |
39
+
|`--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 |
40
+
|`--end-cursor`| Override the end cursor, typed the same way as `--start-cursor`|
37
41
|`--start-cursor-ts`| Override start cursor for timestamp incremental models (ISO format) |
38
42
|`--end-cursor-ts`| Override end cursor for timestamp incremental models (ISO format) |
39
43
|`--start-cursor-int`| Override start cursor for integer incremental models |
40
44
|`--end-cursor-int`| Override end cursor for integer incremental models |
45
+
|`SELECTOR ...`| Positional selectors, the same as `--select`|
41
46
|`--select`, `-s`| Select specific models |
42
47
|`--exclude`| Exclude specific models |
43
48
|`--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 |
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/query.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,14 @@
6
6
7
7
Online: https://sqlbuild.com/docs/cli/query/
8
8
9
+
## Contents
10
+
11
+
- Usage
12
+
- Flags
13
+
- Output formats
14
+
- Errors
15
+
- Examples
16
+
9
17
Execute ad hoc SQL against the active project connection. Useful for inspecting data, debugging models, or running one-off queries without leaving the SQLBuild CLI.
10
18
11
19
## Usage
@@ -29,6 +37,7 @@ File paths are resolved from the current working directory.
29
37
|`sql`| SQL to execute (positional argument) |
30
38
|`--file`| Read SQL from a file instead of the command line |
31
39
|`--format`| Output format: `long` (default), `table`, `json`, or `csv`|
40
+
|`--json`| Shorthand for `--format json`|
32
41
|`--limit`| Maximum rows to return (default: 20) |
33
42
|`--no-limit`| Disable the row limit |
34
43
|`--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 |
@@ -101,7 +110,7 @@ sqb query "SELECT * FROM dev.fact_orders"
101
110
sqb query "SELECT * FROM dev.dim_customers" --format table --limit 50
102
111
103
112
# Export to JSON
104
-
sqb query "SELECT * FROM dev.daily_revenue" --format json --no-limit
113
+
sqb query "SELECT * FROM dev.daily_revenue" --json --no-limit
0 commit comments