Skip to content

Commit 81d85b9

Browse files
committed
docs: plainer Recall homepage step and SQL macro constant scope
1 parent bf8120b commit 81d85b9

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎src/sqlbuild/.agents/skills/sqlbuild/references/docs/concepts/macros/sql-macros.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,11 @@ other (`P020`); compose them in the model by passing results, as in
233233
a visible name.
234234

235235
A body may not call `__ref()`, `__source()` or `__seed()` (`P016`): pass relations in as `RELATION`
236-
arguments. `@const(...)` and `@enum(...)` in a body resolve from the macro file's own folder, like
237-
audits and unlike Python macros; one that is not visible from there fails with `S026`. Make it a
238-
parameter and pass the value from the caller instead. SQL macros a body calls resolve the same way,
239-
so a macro can call a folder-local macro beside it that its callers cannot see.
236+
arguments. `@const(...)` and `@enum(...)` in a body resolve from the macro file's folder, not from
237+
the calling model, so a macro means the same thing wherever it's called. A constant or enum that
238+
isn't visible from there fails with `S026`; to use a caller's value, make it an argument and pass
239+
`@const(...)` at the call site. SQL macros a body calls resolve the same way, so a macro can call a
240+
folder-local macro beside it that its callers cannot see.
240241

241242
## Checks and tools
242243

‎website/public/index.html‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ <h3>Archive old tables before deleting them</h3>
368368
<div class="step">
369369
<div class="step-text">
370370
<span class="num">09 · Investigate</span>
371-
<h3>Find out what happened, then check what's true now</h3>
371+
<h3>Look back at past runs</h3>
372372
<p>
373-
SQLBuild records every run: what ran, the SQL it executed, audit results and everything it printed. You or an agent can query that history in SQL, and the same command queries the warehouse to check what's true now.
373+
SQLBuild keeps a record of every run: what ran, the SQL, audit results and the output. Query it in SQL, and query the warehouse with the same command.
374374
</p>
375375
<p>
376-
Here an audit started warning on the latest run, but the build still exited 0. The first two commands show when it started and what the run printed. The third finds the cause, still in prod: a refund stored as a negative payment.
376+
Here an audit started warning but the build still passed. Two queries find when it started and what the run printed; a third finds the bad row, still in prod.
377377
</p>
378-
<p>History lives in a SQLite file in your project, or in ClickHouse for a team. No service to run, no account, no paid tier.</p>
378+
<p>The record is a SQLite file in your project, or ClickHouse for a team.</p>
379379
<p class="more"><a href="/docs/concepts/observability/recall/">How Recall works →</a></p>
380380
</div>
381381
<pre class="terminal"><span class="cmd">sqb recall query &quot;SELECT substr(a.invocation_started_at, 1, 16) AS run,

‎website/src/content/docs/docs/concepts/macros/sql-macros.mdx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,11 @@ other (`P020`); compose them in the model by passing results, as in
220220
a visible name.
221221

222222
A body may not call `__ref()`, `__source()` or `__seed()` (`P016`): pass relations in as `RELATION`
223-
arguments. `@const(...)` and `@enum(...)` in a body resolve from the macro file's own folder, like
224-
audits and unlike Python macros; one that is not visible from there fails with `S026`. Make it a
225-
parameter and pass the value from the caller instead. SQL macros a body calls resolve the same way,
226-
so a macro can call a folder-local macro beside it that its callers cannot see.
223+
arguments. `@const(...)` and `@enum(...)` in a body resolve from the macro file's folder, not from
224+
the calling model, so a macro means the same thing wherever it's called. A constant or enum that
225+
isn't visible from there fails with `S026`; to use a caller's value, make it an argument and pass
226+
`@const(...)` at the call site. SQL macros a body calls resolve the same way, so a macro can call a
227+
folder-local macro beside it that its callers cannot see.
227228

228229
## Checks and tools
229230

0 commit comments

Comments
 (0)