Skip to main content
An enum can describe the allowed domain of a model column as well as provide individual SQL literals. These are separate uses:
  • @enum("market_type").WIN inserts one validated value into SQL.
  • type market_type declares that a model column uses the complete enum domain.

Declare an enum-typed column

Use the enum name as the column type:
SQLBuild does not send market_type to the warehouse as a physical type and does not create a warehouse-native enum. It translates the enum into portable column metadata:

Contract behavior

With contract enforced, SQLBuild runs the generated accepted_values audit with the model’s other audits. Its severity and timing follow the model’s ordinary audit and materialization settings. With contract none, SQLBuild still resolves the enum to its portable scalar column type but does not generate the domain audit. This behavior is the same on adapters with and without native enum support. The physical warehouse column remains an ordinary string or integer column. Changing the members of an enum-typed contract changes the model’s contract identity and generated validation.