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 ColumnDefinition: (source)
Constructor: ColumnDefinition(column_type, options)
Framework-agnostic description of a database column.
Column types such as ~orionis.orm.schema.types.Integer or
~orionis.orm.schema.types.String subclass this definition and
expose a fluent API to declare constraints. The definition never touches
the underlying SQL engine; the database compiler translates it later.
| Method | __init__ |
Initialize the column definition with its type metadata. |
| Method | __repr__ |
Return a concise developer representation of the column. |
| Method | auto |
Mark the column as auto-incrementing. |
| Method | comment |
Attach a descriptive comment rendered alongside the column DDL. |
| Method | default |
Assign a default value applied when no value is provided on insert. |
| Method | foreign |
Declare a foreign key pointing at another table column. |
| Method | has |
Report whether a default value has been assigned. |
| Method | index |
Create a non-unique index on the column. |
| Method | nullable |
Allow the column to store NULL values. |
| Method | primary |
Mark the column as the primary key of the table. |
| Method | unique |
Add a unique constraint to the column. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | column |
Undocumented |
| Instance Variable | comment |
Undocumented |
| Instance Variable | default |
Undocumented |
| Instance Variable | foreign |
Undocumented |
| Instance Variable | has |
Undocumented |
| Instance Variable | is |
Undocumented |
| Instance Variable | is |
Undocumented |
| Instance Variable | is |
Undocumented |
| Instance Variable | is |
Undocumented |
| Instance Variable | name |
Undocumented |
Initialize the column definition with its type metadata.
| Parameters | |
columnColumnType | Logical column type used by the SQL compiler. |
options:ColumnOptions or None, optional | Type-specific knobs mirroring the SQLAlchemy constructor
keywords of the concrete subclass. Defaults to every
ColumnOptions field at its own default value. |
| Returns | |
None | This method does not return a value. |
Return a concise developer representation of the column.
| Returns | |
str | Representation including name and logical type. |
Mark the column as auto-incrementing.
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
Attach a descriptive comment rendered alongside the column DDL.
| Parameters | |
text:str | Comment text stored by the database engine. |
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
Assign a default value applied when no value is provided on insert.
| Parameters | |
value:Any | Static value, or a zero-argument callable evaluated per insert. |
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
Declare a foreign key pointing at another table column.
| Parameters | |
reference:str | Qualified reference in the form "table.column". |
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
| Raises | |
ValueError | If the reference is not a valid "table.column" string. |
Create a non-unique index on the column.
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
Allow the column to store NULL values.
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
Mark the column as the primary key of the table.
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |
Add a unique constraint to the column.
| Returns | |
ColumnDefinition | The same definition, enabling fluent chaining. |