Enums
Enums define a fixed set of allowed values for a column. They are useful for status fields, categories, roles, and any column that should only accept a predefined list of options.
Create an enum
- Open the Enums tab in the left sidebar
- Click + Add Enum
- Enter the enum name (e.g.,
status,role,priority) - Add values — each value represents one allowed option
The new enum appears in the Enums tab list and becomes available as a column type.
Enum properties
| Property | Description |
|---|---|
| Name | The enum type name (e.g., order_status, user_role) |
| Schema | Optional schema prefix |
| Values | Ordered list of allowed values |
Managing values
- Click + Add Value to append a new value to the list
- Each value has a name field (e.g.,
active,inactive,pending) - Click the delete icon next to a value to remove it
- Drag values to reorder them
Use an enum as a column type
Once an enum is created, you can reference it as a column type:
- Open a table in the edit panel
- Add or edit a column
- In the Type field, type the enum name (e.g.,
order_status) - The autocomplete dropdown shows matching enums — select the one you want
The column type is now linked to the enum. On the canvas, the column displays the enum type name.
Edit an enum
Click on any enum in the Enums tab to open its editor. You can:
- Rename the enum
- Add, remove, or reorder values
- Changes are saved as you edit
Delete an enum
- Select the enum in the Enums tab
- Click the Delete button
Deleting an enum does not automatically update columns that reference it. Those columns will retain the enum name as a plain text type string. Update or reassign those column types manually after deletion.
Example
A typical order_status enum:
| Value |
|---|
pending |
confirmed |
shipped |
delivered |
cancelled |
Referenced by the orders.status column with type order_status.
Tips
- Use descriptive enum names that indicate the domain —
payment_methodis clearer thanmethod - Keep enum values lowercase and consistent (e.g.,
snake_caseorUPPER_CASE— pick one convention) - Enums are especially useful for columns that drive application logic (status machines, role-based access, configuration flags)
- If you import a schema via SQL or DBML, existing enum definitions are automatically parsed and created