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

Ensure a value is not already stored in a database column.

Asynchronous schema validation awaits the current connection and preserves its transaction. Explicit synchronous validation bridges through orionis.aio.loop.Loop.runSync and blocks the calling thread. A synchronous call made inside an event loop uses an isolated connection.

Async Method __existsIsolated Run the probe on a connection owned by the calling event loop.
Async Method __existsShared Run the probe on the connection shared by the application.
Method __init__ Initialize the rule with the database table and column to check.
Method __plan Build the query plan probing for a conflicting row.
Method enforce Validate a field value as unique.
Async Method enforceAsync Check uniqueness on the current loop and its active transaction.
Class Variable __code__ Undocumented
Class Variable __message__ Undocumented
Class Variable __slots__ Undocumented
Instance Variable _column Undocumented
Instance Variable _connection Undocumented
Instance Variable _ignore Undocumented
Instance Variable _ignore_column Undocumented
Instance Variable _table Undocumented

Inherited from Rule:

Method validate Validate the field value and return a failure when invalid.
Async Method validateAsync Await the rule and describe an invalid field value.
Instance Variable _code Undocumented
Instance Variable _message Undocumented
async def __existsIsolated(self, plan: SelectPlan) -> bool: (source)

Run the probe on a connection owned by the calling event loop.

Parameters
plan:SelectPlanPlan matching the rows that break uniqueness.
Returns
boolReturn True when a conflicting row exists.
async def __existsShared(self, plan: SelectPlan) -> bool: (source)

Run the probe on the connection shared by the application.

Parameters
plan:SelectPlanPlan matching the rows that break uniqueness.
Returns
boolReturn True when a conflicting row exists.
def __init__(self, table: str, column: str, *, ignore: object = None, ignore_column: str = 'id', connection: str | None = None, message: str | None = None): (source)

Initialize the rule with the database table and column to check.

Parameters
table:strLogical table name, without the connection prefix.
column:strColumn name within the table.
ignore:object, optionalRow identifier excluded from the lookup, so updating a record does not clash with itself.
ignore_column:str, optionalColumn ignore is matched against.
connection:str | None, optionalNamed connection to query, or None for the default one.
message:str | None, optionalOverride message used when validation fails.
Returns
NoneThis method initializes the instance and returns None.
def __plan(self, value: object) -> SelectPlan: (source)

Build the query plan probing for a conflicting row.

Parameters
value:objectValue searched for in the configured column.
Returns
SelectPlanPlan matching at most one row that breaks uniqueness.
def enforce(self, field: str, value: object, instance: object) -> bool: (source)

Validate a field value as unique.

Parameters
field:strField name associated with the value.
value:objectValue to validate.
instance:objectOwning object instance. This argument is accepted for interface compatibility.
Returns
boolReturn True when the value passes validation.
async def enforceAsync(self, field: str, value: object, instance: object) -> bool: (source)

Check uniqueness on the current loop and its active transaction.

Parameters
field:strField name associated with the value.
value:objectValue searched for in the configured column.
instance:objectSchema instance owning the field.
Returns
boolWhether no conflicting row is visible to the current connection.
__code__: str = (source)

Undocumented

__message__: str = (source)

Undocumented

__slots__: tuple[str, ...] = (source)

Undocumented

Undocumented

_connection: str | None = (source)

Undocumented

Undocumented

_ignore_column: str = (source)

Undocumented

Undocumented