SQL backends for the various services.
Before using this module, call initialize(). This has to be done before CONF() because it sets up configuration options.
Bases: oslo_db.sqlalchemy.models.ModelBase
Bases: sqlalchemy.sql.type_api.TypeDecorator
alias of Text
Applies filtering and limit to a query.
Parameters: |
|
---|---|
Returns: | updated query |
Converts select sqlalchemy exceptions into HTTP 409 Conflict.
Ensure that the length of string field do not exceed the limit.
This decorator check the initialize arguments, to make sure the length of string field do not exceed the length limit, or raise a ‘StringLengthExceeded’ exception.
Use decorator instead of inheritance, because the metaclass will check the __tablename__, primary key columns, etc. at the class definition.
Return a SQLAlchemy session in a scoped transaction.
Ensure list truncation is detected in Driver list entity methods.
This is designed to wrap and sql Driver list_{entity} methods in order to calculate if the resultant list has been truncated. Provided a limit dict is found in the hints list, we increment the limit by one so as to ask the wrapped function for one more entity than the limit, and then once the list has been generated, we check to see if the original limit has been exceeded, in which case we truncate back to that limit and set the ‘truncated’ boolean to ‘true’ in the hints limit dict.
Renames tables with foreign key constraints.
Tables are renamed after first removing constraints. The constraints are replaced after the rename is complete.
This works on databases that don’t support renaming tables that have constraints on them (DB2).
renames is a dict, mapping {‘to_table_name’: from_table, ...}