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 DatabaseInspector: (source)

Constructor: DatabaseInspector(manager, name)

View In Hierarchy

Inspect user objects without opening a separate database engine.

Method __init__ Bind inspection to a named connection.
Async Method _findTableName Find a requested table with a filtered catalog query.
Method _resolveTableName Match catalog names according to the driver's identifier rules.
Async Method _serverDetails Read server column, index and foreign-key metadata.
Async Method _sqliteDetails Read SQLite column, index and foreign-key metadata.
Async Method connectionCount Return server session count if the driver exposes it.
Async Method databaseSize Return database size in bytes when available.
Async Method listDomains List PostgreSQL domains, which require DROP DOMAIN.
Async Method listMaterializedViews List materialized views outside system schemas.
Async Method listTables List non-system tables visible on the selected database.
Async Method listTypes List user-defined types that may be removed by db:wipe.
Async Method listViews List user views visible on the selected database.
Method quoteIdentifier Quote a catalog identifier using the selected SQL dialect.
Async Method rowCount Count rows in a table returned by the catalog.
Async Method tableDetails Describe a physical table, including columns, indexes and keys.
Async Method tableSize Return physical table size in bytes when exposed by the driver.
Async Method tableSizes Read physical sizes for all catalog tables in one query.
Async Method viewCounts Count ordinary and materialized views without loading their names.
Class Variable __slots__ Undocumented
Instance Variable config Undocumented
Instance Variable connection Undocumented
Instance Variable driver Undocumented
Instance Variable name Undocumented
def __init__(self, manager: IConnectionManager, name: str | None = None): (source)

Bind inspection to a named connection.

Parameters
manager:IConnectionManagerManager that resolves database configurations and connections.
name:str | None, optionalNamed connection, or the configured default.
Returns
NoneComplete the documented operation without returning a value.
async def _findTableName(self, name: str) -> str | None: (source)

Find a requested table with a filtered catalog query.

Parameters
name:strQualified or unqualified table name requested by the user.
Returns
str | NoneUnambiguous catalog table name, if one exists.
def _resolveTableName(self, name: str, tables: list[str]) -> str | None: (source)

Match catalog names according to the driver's identifier rules.

Parameters
name:strRequested table name.
tables:list[str]Table names reported by the catalog.
Returns
str | NoneUnambiguous catalog table name, if one exists.
async def _serverDetails(self, name: str) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]: (source)

Read server column, index and foreign-key metadata.

Parameters
name:strCatalog table name to inspect.
Returns
tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]Columns, indexes and foreign keys.
async def _sqliteDetails(self, name: str) -> tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]: (source)

Read SQLite column, index and foreign-key metadata.

Parameters
name:strName of the table to inspect.
Returns
tuple[list[dict[str, Any]], list[dict[str, Any]], list[dict[str, Any]]]Columns, indexes and foreign keys.
async def connectionCount(self) -> int | None: (source)

Return server session count if the driver exposes it.

Returns
int | NoneOpen server sessions, or None when unavailable.
async def databaseSize(self) -> int | None: (source)

Return database size in bytes when available.

Returns
int | NoneDatabase size, or None when unavailable.
async def listDomains(self) -> list[str]: (source)

List PostgreSQL domains, which require DROP DOMAIN.

Returns
list[str]Domain names in catalog order, or an empty list for other drivers.
async def listMaterializedViews(self) -> list[str]: (source)

List materialized views outside system schemas.

Returns
list[str]Materialized view names in catalog order.
async def listTables(self) -> list[str]: (source)

List non-system tables visible on the selected database.

Returns
list[str]Table names in catalog order.
async def listTypes(self) -> list[str]: (source)

List user-defined types that may be removed by db:wipe.

Returns
list[str]Removable type names in catalog order.
async def listViews(self) -> list[str]: (source)

List user views visible on the selected database.

Returns
list[str]View names in catalog order.
def quoteIdentifier(self, name: str, *, qualified: bool = True) -> str: (source)

Quote a catalog identifier using the selected SQL dialect.

Parameters
name:strIdentifier returned by the database catalog.
qualified:bool, optionalWhether to split a schema-qualified identifier.
Returns
strIdentifier escaped for use in a SQL statement.
Raises
ValueErrorIf an identifier or one of its components is empty.
async def rowCount(self, name: str) -> int: (source)

Count rows in a table returned by the catalog.

Parameters
name:strCatalog table name to count.
Returns
intExact row count.
async def tableDetails(self, name: str) -> dict[str, Any]: (source)

Describe a physical table, including columns, indexes and keys.

Parameters
name:strTable name provided to db:table.
Returns
dict[str, Any]Table metadata and statistics.
Raises
ValueErrorIf the selected table is absent from the catalog.
async def tableSize(self, name: str) -> int | None: (source)

Return physical table size in bytes when exposed by the driver.

Parameters
name:strCatalog table name to inspect.
Returns
int | NonePhysical size, or None when unavailable.
async def tableSizes(self, tables: list[str]) -> dict[str, int]: (source)

Read physical sizes for all catalog tables in one query.

Parameters
tables:list[str]Table names returned by listTables.
Returns
dict[str, int]Sizes in bytes keyed by table name. Missing sizes are omitted.
async def viewCounts(self) -> tuple[int, int]: (source)

Count ordinary and materialized views without loading their names.

Returns
tuple[int, int]Ordinary view count followed by materialized view count.
__slots__: tuple[str, ...] = (source)

Undocumented

Undocumented

connection: IConnection = (source)

Undocumented

Undocumented

Undocumented