Skip to content

Commit eba68b5

Browse files
Update docs
1 parent 9a8b6a7 commit eba68b5

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

docs/concepts/macros/macro_variables.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This example used one of SQLMesh's predefined variables, but you can also define
4444

4545
We describe SQLMesh's predefined variables below; user-defined macro variables are discussed in the [SQLMesh macros](./sqlmesh_macros.md#user-defined-variables) and [Jinja macros](./jinja_macros.md#user-defined-variables) pages.
4646

47-
## Predefined Variables
47+
## Predefined variables
4848
SQLMesh comes with predefined variables that can be used in your queries. They are automatically set by the SQLMesh runtime.
4949

5050
Most predefined variables are related to time and use a combination of prefixes (start, end, etc.) and postfixes (date, ds, ts, etc.). They are described in the next section; [other predefined variables](#runtime-variables) are discussed in the following section.
@@ -120,7 +120,7 @@ All predefined temporal macro variables:
120120

121121
### Runtime variables
122122

123-
SQLMesh provides two other predefined variables used to modify model behavior based on information available at runtime.
123+
SQLMesh provides additional predefined variables used to modify model behavior based on information available at runtime.
124124

125125
* @runtime_stage - A string value denoting the current stage of the SQLMesh runtime. Typically used in models to conditionally execute pre/post-statements (learn more [here](../models/sql_models.md#optional-prepost-statements)). It returns one of these values:
126126
* 'loading' - The project is being loaded into SQLMesh's runtime context.
@@ -133,5 +133,11 @@ SQLMesh provides two other predefined variables used to modify model behavior ba
133133
* @this_model - A string value containing the name of the physical table the model view selects from. Typically used to create [generic audits](../audits.md#generic-audits). In the case of [on_virtual_update statements](../models/sql_models.md#optional-on-virtual-update-statements) it contains the qualified view name instead.
134134
* Can be used in model definitions when SQLGlot cannot fully parse a statement and you need to reference the model's underlying physical table directly.
135135
* Can be passed as an argument to macros that access or interact with the underlying physical table.
136-
* @this_env - A string value containing the name of the current [environment](../environments.md). Only available in [`before_all` and `after_all` statements](../../guides/configuration.md#before_all-and-after_all-statements), as well as in macros invoked within them.
137-
* @model_kind_name - A string value containing the name of the current model kind. Intended to be used in scenarios where you need to control the [physical properties in model defaults](../../reference/model_configuration.md#model-defaults).
136+
* @model_kind_name - A string value containing the name of the current model kind. Intended to be used in scenarios where you need to control the [physical properties in model defaults](../../reference/model_configuration.md#model-defaults).
137+
138+
#### Before all and after all variables
139+
140+
The following variables are also available in [`before_all` and `after_all` statements](../../guides/configuration.md#before_all-and-after_all-statements), as well as in macros invoked within them.
141+
142+
* @this_env - A string value containing the name of the current [environment](../environments.md).
143+
* @schemas - A list of the schema names of the [virtual layer](../../concepts/glossary.md#virtual-layer) of the current environment.

0 commit comments

Comments
 (0)