THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
class Enum(ColumnDefinition): (source)
Constructor: Enum(*enums, name, create_constraint, native_enum, ...)
String-backed enumeration column.
def __init__(self, *enums:
str, name: str | None = None, create_constraint: bool = False, native_enum: bool = True, length: int | None = None, validate_strings: bool = False):
(source)
¶
Construct an enum.
| Parameters | |
*enums:str | Allowed string values, at least one is required. |
name:str or None, optional | Name of the enumerated database type. |
createbool, optional | When emulating a non-native enum, also build a CHECK constraint against the allowed values. |
nativebool, optional | Whether to use the backend's native ENUM type. |
length:int or None, optional | Custom VARCHAR length for non-native enumerations. |
validatebool, optional | Whether to validate string literals against allowed values. |
| Returns | |
None | This method does not return a value. |
| Raises | |
ValueError | If no values are provided or any value is not a string. |