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

class IConnectionManager(ABC): (source)

Known subclasses: orionis.database.ConnectionManager

View In Hierarchy

Undocumented

Method addConnection Register or replace a named connection configuration at runtime.
Method configFor Retrieve the configuration for a named connection.
Method connection Resolve the connection registered under the given name.
Async Method disconnect Dispose one or all cached connections.
Method getDefaultName Return the name of the default connection.
Method hasConnection Report whether a connection configuration exists.
Method setDefaultName Change the default connection name.
Class Variable __slots__ Undocumented
@abstractmethod
def addConnection(self, name: str, config: dict[str, Any]): (source)

Register or replace a named connection configuration at runtime.

A live connection built from a previous configuration keeps serving until disconnect is called for that name.

Parameters
name:strConnection name to register.
config:dictDriver configuration for the connection.
Returns
NoneThis method does not return a value.
Raises
ValueErrorIf the name is empty.
TypeErrorIf the configuration is not a mapping.
@abstractmethod
def configFor(self, name: str | None = None) -> dict[str, Any]: (source)

Retrieve the configuration for a named connection.

Parameters
name:str or None, optionalConnection name as declared in the database configuration, or None for the default connection.
Returns
dictThe driver configuration for the connection.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
@abstractmethod
def connection(self, name: str | None = None) -> IConnection: (source)

Resolve the connection registered under the given name.

The connection is built on first access and cached for reuse.

Parameters
name:str or None, optionalConnection name as declared in the database configuration, or None for the default connection.
Returns
IConnectionConnection bound to its configuration.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
@abstractmethod
async def disconnect(self, name: str | None = None): (source)

Dispose one or all cached connections.

Parameters
name:str or None, optionalConnection to dispose, or None to dispose every cached connection.
Returns
NoneThis method does not return a value.
@abstractmethod
def getDefaultName(self) -> str: (source)

Return the name of the default connection.

Returns
strDefault connection name as configured.
@abstractmethod
def hasConnection(self, name: str) -> bool: (source)

Report whether a connection configuration exists.

Parameters
name:strConnection name to look up.
Returns
boolTrue when the configuration is registered.
@abstractmethod
def setDefaultName(self, name: str): (source)

Change the default connection name.

Parameters
name:strConnection name to use as the default; must already be declared in the configuration.
Returns
NoneThis method does not return a value.
Raises
ConnectionNotFoundExceptionIf the connection is not declared in the configuration.
__slots__: tuple = (source)

Undocumented