Lists
Square brackets declare an ordered list. Lists preserve authored order and allow duplicates:Sets
Curly braces declare a set. Sets reject duplicate typed values and use a stable order when SQLBuild renders or fingerprints them:{true, 1} is valid because a boolean and an integer are different logical types.
{"GB", "FR", "GB"} fails compilation instead of silently discarding the duplicate.
Objects
Parenthesized key-value entries declare a string-keyed object. Values may be scalars, lists, sets, or other objects:Collection rules
Lists and sets must be non-empty and have one compatible element type. Nullable elements do not determine the type, so[1, null, 2] is valid, while these declarations fail:
Value-list rendering
Lists and sets render as a parenthesized value list by default. This is designed forIN:
Native-array rendering
Setrender_as array to request an adapter-native array:
value_list and array modes as lists. Scalar and object constants reject
render_as because those rendering modes do not apply to them.
BigQuery does not support arrays containing arrays. SQL Server has no native array representation.
Unsupported requests fail compilation rather than silently changing representation.
Project default
Set the default for list and set constants insqlbuild_project.toml:
- The declaration’s
render_asfield - Project
[constants].collection_rendering - The
value_listdefault
Stable values
- List order and duplicates are preserved.
- Set order is ignored; membership is stored in a stable order.
- Object key order is ignored; keys are stored in a stable order.
- Changing set membership or object values changes dependent query identity.

