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__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | column |
Logical column type used by the SQL compiler. |
| Instance Variable | comment |
Comment attached to the column definition. |
| Instance Variable | default |
Default value supplied through _NO_DEFAULT. |
| Instance Variable | foreign |
Foreign-key target referenced by this column. |
| Instance Variable | has |
Has index flag used by ColumnDefinition. |
| Instance Variable | is |
Is auto increment flag used by ColumnDefinition. |
| Instance Variable | is |
Is nullable flag used by ColumnDefinition. |
| Instance Variable | is |
Is primary flag used by ColumnDefinition. |
| Instance Variable | is |
Is unique flag used by ColumnDefinition. |
| Instance Variable | name |
Attribute name is attached later by the model metaclass. |
Initialize the column definition with its type metadata.
| Parameters | |
columnorionis.orm.schema.types.ColumnType | Logical column type used by the SQL compiler. |
options:orionis.orm.schema.column.ColumnOptions or None, optional | Type-specific knobs mirroring the SQLAlchemy constructor
keywords of the concrete subclass. Defaults to every
orionis.orm.schema.column.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 | |
orionis.orm.schema.column.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 | |
orionis.orm.schema.column.ColumnDefinition | The same definition, enabling fluent chaining. |
Assign a default value applied when no value is provided on insert.
| Parameters | |
value:typing.Any | Static value, or a zero-argument callable evaluated per insert. |
| Returns | |
orionis.orm.schema.column.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 | |
orionis.orm.schema.column.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 | |
orionis.orm.schema.column.ColumnDefinition | The same definition, enabling fluent chaining. |
Allow the column to store NULL values.
| Returns | |
orionis.orm.schema.column.ColumnDefinition | The same definition, enabling fluent chaining. |
Mark the column as the primary key of the table.
| Returns | |
orionis.orm.schema.column.ColumnDefinition | The same definition, enabling fluent chaining. |
Add a unique constraint to the column.
| Returns | |
orionis.orm.schema.column.ColumnDefinition | The same definition, enabling fluent chaining. |