Simple variables and parameterization in SDF
@
syntax, instead of \{\{ \}\}
--vars
flag on CLI commands like sdf compile
and sdf run
@my_variable
and use it in a SQL query.
preprocessor
option to sql-vars
in the workspace.sdf.yml
like so:
@my_variable
, let’s add a vars
yml block to the workspace like so:
--vars
flag on the CLI. For example:
@my_variable
with my_value
in the SQL query. The resulting query will look like this:
@my_variable
with 123
in the SQL query. The resulting query will look like this:
vars
block in the workspace.sdf.yml
file like so:
all
in the workspace.sdf.yml as seen above.vars.yml
file. This is useful when you have a lot of variables to set. Here is an example of a vars.yml
file:
--vars
flag like so:
vars.yml
is the path to the file.