Variables and environments: The four types
Write {{name}} anywhere in a script. Substitution happens once, at pre-flight, before a singlestatement is sent.
Write {{name}} anywhere in a script. Substitution happens once, at pre-flight, before a single
statement is sent.
The type is on the declaration, so a script author does not decide quoting at every usage site.
| Type | Emits | Use for |
|---|---|---|
text |
A dialect-escaped string literal — an apostrophe is safe | Values compared against a string column |
identifier |
A dialect-quoted identifier | Schema, table, or database names |
number |
Validated as a number, emitted invariant. A non-number fails pre-flight | Counts, thresholds, ids |
raw |
Verbatim — the value becomes part of the SQL | Genuine SQL fragments, and nothing else |
raw is flagged at preview time:
This script substitutes values raw. Use
|literalor|identunless the value is meant to be SQL.