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 Database(BaseEntity): (source)
Represent the configuration entity for a database-backed cache store.
Mirrors database cache store configuration array, supporting a dedicated connection/table for cache entries and an independent connection/table for the atomic locks used by Cache::lock().
| Method | __post |
Validate the Database cache configuration after initialization. |
| Method | __validate |
Validate the connection property. |
| Method | __validate |
Validate the driver property. |
| Method | __validate |
Validate the lock_table property. |
| Method | __validate |
Validate the table property. |
| Instance Variable | connection |
The database connection name used to store cache entries. Resolved from the DB_CACHE_CONNECTION environment variable or None to use the application's default connection. |
| Instance Variable | driver |
The driver type. Defaults to 'database'. |
| Instance Variable | lock |
The database table name used to store cache locks. Must match the pattern [a-z_]+ when provided. Resolved from the DB_CACHE_LOCK_TABLE environment variable or None to let the driver fall back to its own default. |
| Instance Variable | table |
The database table name used to store cache entries. Must match the pattern [a-z_]+. Resolved from the DB_CACHE_TABLE environment variable or defaults to 'cache'. |
Inherited from BaseEntity:
| Class Method | _cached |
Retrieve field definitions and normalized types cached by class. |
| Method | get |
Describe field names, normalized types, defaults, and metadata. |
| Method | to |
Convert the dataclass instance to a recursively copied dictionary. |
| Class Variable | __slots__ |
Undocumented |
Validate the Database cache configuration after initialization.
| Returns | |
None | Validates every field against its declared type hint. |
| Raises | |
TypeError | If any property does not match its expected type. |
ValueError | If table or lock_table fail table-name validation. |
Validate the driver property.
| Returns | |
None | This method performs validation and returns None. |
| Raises | |
TypeError | If driver is not a string. |
ValueError | If driver is an empty string. |
Validate the lock_table property.
| Returns | |
None | This method performs validation and returns None. |
| Raises | |
TypeError | If lock_table is neither a string nor None. |
ValueError | If lock_table is provided but does not match the required pattern. |
Validate the table property.
| Returns | |
None | This method performs validation and returns None. |
| Raises | |
TypeError | If table is not a string. |
ValueError | If table does not match the required pattern. |
The database connection name used to store cache entries. Resolved from the DB_CACHE_CONNECTION environment variable or None to use the application's default connection.