ORIONIS API REFERENCE

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

Contract of the entry point backing the DB facade.

Implementations resolve named connections, start model-less queries, and drive transactions. They are registered as singletons, so every method must be free of per-query state: the connection scope travels with the returned object rather than being stored on the service.

Async Method beginTransaction Begin a transaction, or a savepoint when one is already active.
Async Method commit Commit the innermost active transaction or savepoint.
Method connection Return a gateway scoped to the connection with the given name.
Async Method execute Run a raw data-modifying statement and return the affected rows.
Method getDefaultName Return the name of the default connection.
Async Method rollback Roll back the innermost active transaction or savepoint.
Async Method select Run a raw SELECT statement and return its rows.
Method setDefaultName Change the connection used when none is specified.
Async Method statement Run a raw statement without inspecting its result.
Method table Build a fluent, model-less query over a plain table name.
Method transaction Return a transaction usable as an async context manager.
Class Variable __slots__ Undocumented
async def beginTransaction(self, name: str | None = None): (source)

Begin a transaction, or a savepoint when one is already active.

Parameters
name:str or None, optionalNamed connection to start the transaction on, or None for the default connection.
Returns
NoneThis method does not return a value.
Raises
TransactionExceptionIf the transaction cannot be started.
async def commit(self, name: str | None = None): (source)

Commit the innermost active transaction or savepoint.

Parameters
name:str or None, optionalNamed connection to commit, or None for the default connection.
Returns
NoneThis method does not return a value.
Raises
TransactionExceptionIf no transaction is active.
def connection(self, name: str | None = None) -> Self: (source)

Return a gateway scoped to the connection with the given name.

Parameters
name:str or None, optionalConnection name as declared in the database configuration, or None for the default connection.
Returns
SelfGateway bound to the requested connection.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
async def execute(self, sql: str, bindings: dict[str, object] | None = None, name: str | None = None) -> int: (source)

Run a raw data-modifying statement and return the affected rows.

Parameters
sql:strRaw SQL using named :param placeholders.
bindings:dict or None, optionalValues bound to the placeholders of the statement.
name:str or None, optionalNamed connection to run the statement on, or None for the connection this gateway is scoped to.
Returns
intNumber of affected rows.
Raises
QueryExceptionIf the statement fails to execute.
def getDefaultName(self) -> str: (source)

Return the name of the default connection.

Returns
strName of the connection used when none is specified.
async def rollback(self, name: str | None = None): (source)

Roll back the innermost active transaction or savepoint.

Parameters
name:str or None, optionalNamed connection to roll back, or None for the default connection.
Returns
NoneThis method does not return a value.
Raises
TransactionExceptionIf no transaction is active.
async def select(self, sql: str, bindings: dict[str, object] | None = None, name: str | None = None) -> list[dict[str, object]]: (source)

Run a raw SELECT statement and return its rows.

Parameters
sql:strRaw SQL using named :param placeholders.
bindings:dict or None, optionalValues bound to the placeholders of the statement.
name:str or None, optionalNamed connection to run the statement on, or None for the connection this gateway is scoped to.
Returns
list of dictOne dictionary per row keyed by column name.
Raises
QueryExceptionIf the statement fails to execute.
def setDefaultName(self, name: str): (source)

Change the connection used when none is specified.

Parameters
name:strConnection name as declared in the database configuration.
Returns
NoneThis method does not return a value.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
async def statement(self, sql: str, bindings: dict[str, object] | None = None, name: str | None = None) -> bool: (source)

Run a raw statement without inspecting its result.

Parameters
sql:strRaw SQL statement, typically DDL or a maintenance command.
bindings:dict or None, optionalValues bound to the placeholders of the statement.
name:str or None, optionalNamed connection to run the statement on, or None for the connection this gateway is scoped to.
Returns
boolTrue when the statement executes without errors.
Raises
QueryExceptionIf the statement fails to execute.
def table(self, name: str, *, alias: str | None = None, connection: str | None = None) -> IRawQueryBuilder: (source)

Build a fluent, model-less query over a plain table name.

Parameters
name:strLogical table name, without the connection prefix.
alias:str or None, optionalAlias the table is referred to by inside the query.
connection:str or None, optionalNamed connection to run the query against, or None for the default connection.
Returns
IRawQueryBuilderFluent, model-less query builder over the table.
def transaction(self, name: str | None = None) -> ITransaction: (source)

Return a transaction usable as an async context manager.

Parameters
name:str or None, optionalNamed connection the transaction runs against, or None for the default connection.
Returns
ITransactionContext manager committing on success and rolling back on error.