prql
prql copied to clipboard
Struct syntax
For creating "structs" / "objects" / "composite types" — e.g. snowflake objects, postgres composite types, bigquery structs, what do people think of syntax?
We could use brackets for this:
from employees
derive name: {first_name, last_name}
derive name_concise: {first: first_name, last: last_name}
Possibly structs aren't created that much and we don't want to expend brackets on them. In which case we could just use as
and do something different for struct
rather than other types (currently it just casts:
from employees
derive name: ([first_name, last_name] | as struct)
derive name_concise: ([first: first_name, last: last_name] | as struct)
Or very open to other ideas