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.
Constructor: Unique(table, column, ignore, ignore_column, ...)
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 | __exists |
Run the probe on a connection owned by the calling event loop. |
| Async Method | __exists |
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 | enforce |
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 |
Undocumented |
| Instance Variable | _table |
Undocumented |
Inherited from Rule:
| Method | validate |
Validate the field value and return a failure when invalid. |
| Async Method | validate |
Await the rule and describe an invalid field value. |
| Instance Variable | _code |
Undocumented |
| Instance Variable | _message |
Undocumented |
Run the probe on a connection owned by the calling event loop.
| Parameters | |
plan:SelectPlan | Plan matching the rows that break uniqueness. |
| Returns | |
bool | Return True when a conflicting row exists. |
Run the probe on the connection shared by the application.
| Parameters | |
plan:SelectPlan | Plan matching the rows that break uniqueness. |
| Returns | |
bool | Return True when a conflicting row exists. |
str, column: str, *, ignore: object = None, ignore_column: str = 'id', connection: str | None = None, message: str | None = None):
(source)
¶
orionis.schemas.rule.Rule.__init__Initialize the rule with the database table and column to check.
| Parameters | |
table:str | Logical table name, without the connection prefix. |
column:str | Column name within the table. |
ignore:object, optional | Row identifier excluded from the lookup, so updating a record does not clash with itself. |
ignorestr, optional | Column ignore is matched against. |
connection:str | None, optional | Named connection to query, or None for the default one. |
message:str | None, optional | Override message used when validation fails. |
| Returns | |
None | This method initializes the instance and returns None. |
Build the query plan probing for a conflicting row.
| Parameters | |
value:object | Value searched for in the configured column. |
| Returns | |
SelectPlan | Plan matching at most one row that breaks uniqueness. |