Morph allows run arguments to be used in SQL by using variables.

If you enclose a variable in {{ }}, it is considered a variable and the arguments of the run are entered here. These arguments are used to build dynamic applications such as data applications in MDX.

morph run user -d user_type=admin

Variables can be specified with -d.

{{
	config(
		name="user",
		description="User",
	)
}}

{% if user_type %}
# SQL issued when user_type is sent.
# As with normal SQL, the specified value must be enclosed in single quotes (depending on db syntax)
select * from user where user_type = '{{ user_type }}'
{% else %}
# SQL issued when user_type is not specified
select * from user
{% endif %}