Use Named Expressions¶
Named expressions let you insert runtime values into expression-enabled fields.
Example¶
Instead of hardcoding a term:
Use a named value:
SQL scalar value¶
A SQL scalar value should return one column and zero or one row.
select id
from academic_periods
where current_timestamp between start_on and end_on
and category = 'term';
If the query returns:
| Result | Behavior |
|---|---|
| zero rows | resolves to an empty string |
| one row / one column | resolves to that scalar value as text |
| multiple rows | runtime error |
| multiple columns | runtime error |
Migration from legacy artifact expression¶
Legacy pattern:
Preferred pattern:
Good names¶
Use clear names:
Avoid vague names: