Public declarations
Public declarations are available throughout the project. Put enum files anywhere underenums/ and constant files anywhere under constants/; both roots are discovered recursively.
_.
References
Use@enum("name").MEMBER and @const("name") anywhere public declarations are supported:
Model-local declarations
Use model-local declarations for values that should not enter the project-wide namespace:_. They are available only in that model’s query and SQL hooks; another model cannot resolve them.
Types and validation
Enums must contain at least one member and use one consistent scalar type. String and integer members cannot be mixed. Integer values use explicit member syntax. Names must be SQL identifiers. Duplicate declaration names, duplicate member names, invalid visibility prefixes, and malformed references all fail compilation.Enum-typed contracts
An enum name can be used as a model column type:VARCHAR or INTEGER. With contract enforced, it also adds an accepted_values audit for the enum members, so an out-of-domain value blocks promotion.
Declaration changes participate in change detection. A changed referenced value changes compiled SQL; changed members of an enum-typed contract change the model’s contract identity.
