Skip to content

Commit e61666a

Browse files
committed
docs: say which SQL macro calls the argument check skips
1 parent 4e45d58 commit e61666a

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

  • src/sqlbuild/.agents/skills/sqlbuild/references/docs/concepts/macros
  • website/src/content/docs/docs/concepts/macros

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ error[P017]: argument src of macro clean_orders() needs column is_deleted BOOLEA
258258
= help: pass a relation with these columns: order_id BIGINT, updated_at TIMESTAMP, is_deleted BOOLEAN
259259
```
260260

261-
An argument whose type the compiler cannot infer passes. Arguments built from `__ref()`, macro
262-
calls or parameters of a calling macro, and models with runtime placeholders, are checked only by
263-
the model's own column checks after expansion. All other errors also point at the call and at the
261+
An argument whose type the compiler cannot infer passes. So do calls inside a subquery or in a
262+
query part with `UNION`, `INTERSECT` or `EXCEPT`, arguments built from `__ref()`, macro calls or
263+
parameters of a calling macro, and calls in models with runtime placeholders; the model's own
264+
column checks still run on the expanded SQL. All other errors also point at the call and at the
264265
macro file.
265266

266267
- `sqb format` formats SQL macro files, bodies of every form and the `MACRO` header, and

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ error[P017]: argument src of macro clean_orders() needs column is_deleted BOOLEA
245245
= help: pass a relation with these columns: order_id BIGINT, updated_at TIMESTAMP, is_deleted BOOLEAN
246246
```
247247

248-
An argument whose type the compiler cannot infer passes. Arguments built from `__ref()`, macro
249-
calls or parameters of a calling macro, and models with runtime placeholders, are checked only by
250-
the model's own column checks after expansion. All other errors also point at the call and at the
248+
An argument whose type the compiler cannot infer passes. So do calls inside a subquery or in a
249+
query part with `UNION`, `INTERSECT` or `EXCEPT`, arguments built from `__ref()`, macro calls or
250+
parameters of a calling macro, and calls in models with runtime placeholders; the model's own
251+
column checks still run on the expanded SQL. All other errors also point at the call and at the
251252
macro file.
252253

253254
- `sqb format` formats SQL macro files, bodies of every form and the `MACRO` header, and

0 commit comments

Comments
 (0)