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.
Undocumented
| Method | __add |
Expand a Timestamps marker into its two nullable columns. |
| Method | __build |
Build the table definition from a name and its definitions. |
| Method | __classify |
Route a single schema definition into the shared bucket. |
| Method | __collect |
Group heterogeneous schema definitions into constructor kwargs. |
| Method | __init__ |
Initialize the Schema instance. |
| Method | __parse |
Parse the table name to extract schema and table components. |
| Method | __resolve |
Resolve the connection bound to the configured connection name. |
| Method | __set |
Assign the primary key columns, rejecting duplicate definitions. |
| Async Method | _create |
Compile and execute the CREATE TABLE for name. |
| Method | connection |
Set the connection name for schema operations. |
| Method | create |
Start a fluent table declaration block. |
| Async Method | create |
Create a table from its reusable, versioned definition. |
| Async Method | create |
Create the current schema declared by a concrete model. |
| Async Method | drop |
Drop an existing table. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __conn |
Undocumented |
| Instance Variable | __connection |
Undocumented |
| Instance Variable | __connection |
Undocumented |
Expand a Timestamps marker into its two nullable columns.
| Parameters | |
definition:Timestamps | The timestamps marker carrying the timezone flag. |
bucket:DefinitionBucket | Accumulator updated in place with the new columns. |
| Returns | |
None | The bucket accumulator is mutated in place. |
str, definitions: tuple[ SchemaDefinition, ...]) -> TableDefinition:
(source)
¶
Build the table definition from a name and its definitions.
| Parameters | |
name:str | The name of the table to build, possibly schema.table. |
definitions:tuple | Schema definitions collected for the table. |
| Returns | |
TableDefinition | The complete table definition ready for compilation. |
ColumnDefinition | Comment | ForeignKey | Index | PrimaryKey | Unique, bucket: DefinitionBucket):
(source)
¶
Route a single schema definition into the shared bucket.
| Parameters | |
definition:ColumnDefinition | Comment | ForeignKey | Index | | PrimaryKey | Unique The schema definition to classify. |
bucket:DefinitionBucket | Accumulator updated in place with the classified data. |
| Returns | |
None | The bucket accumulator is mutated in place. |
Initialize the Schema instance.
| Parameters | |
connIConnectionManager | The connection manager for database operations. |
| Returns | |
None | Undocumented |
Resolve the connection bound to the configured connection name.
| Returns | |
IConnection | The connection to use for schema operations. |
Assign the primary key columns, rejecting duplicate definitions.
| Parameters | |
columnlist[str] | Names of the columns composing the primary key. |
kwargs:dict[str, object] | Accumulated TableDefinition keyword arguments, updated in place. |
| Returns | |
None | The kwargs mapping is mutated in place. |
| Raises | |
ValueError | If a primary key was already defined. |
Set the connection name for schema operations.
| Parameters | |
name:str | None, optional | The connection name to use, by default None. |
| Returns | |
Self | The current Schema instance for method chaining. |
| Raises | |
ValueError | If connection name has already been defined. |
Start a fluent table declaration block.
async with schema.create(name) as table: yields a
~orionis.database.schema.blueprint.Blueprint so columns
can be declared fluently (table.string("username"),
table.timestamps(), ...); the table is created once the
block exits without raising.
| Parameters | |
name:str | The name of the table to create. If the table belongs to a non-default schema, use the schema.table format. |
| Returns | |
TableCreation | Async context manager that collects definitions and creates the table after a successful block. |
Create a table from its reusable, versioned definition.
| Parameters | |
definition:TableDefinition | Schema shared with a model through table_definition. Historical migrations should import a versioned definition that remains unchanged when the model adopts a newer version. |
| Returns | |
bool | Whether table creation completed successfully. |
Create the current schema declared by a concrete model.
Use this operation for bootstrap and temporary databases. A historical migration should call createFromDefinition with a versioned table definition so later model changes do not alter migration replay.
| Parameters | |
model:type of Model | Concrete model providing table and connection metadata. An explicit connection selection overrides the model's connection. |
| Returns | |
bool | Whether table creation completed successfully. |
| Raises | |
TypeError | If the argument is not a concrete model class. |