SQL backends for the various services.
Bases: object
Return a SQLAlchemy engine.
If allow_global_engine is True and an in-memory sqlite connection string is provided by CONF, all backends will share a global sqlalchemy engine.
Return a SQLAlchemy session.
Return a SQLAlchemy sessionmaker using the given engine.
Bases: object
Make the model object behave like a dict.
Includes attributes from joins.
Returns the model’s attributes as a dictionary.
If include_extra_dict is True, ‘extra’ attributes are literally included in the resulting dictionary twice, for backwards-compatibility with a broken implementation.
Make the model object behave like a dict.
Bases: sqlalchemy.types.TypeDecorator
alias of Text
Bases: object
Ensures that MySQL connections checked out of the pool are alive.
Borrowed from: http://groups.google.com/group/sqlalchemy/msg/a4ce563d802c929f
Error codes caught: * 2006 MySQL server has gone away * 2013 Lost connection to MySQL server during query * 2014 Commands out of sync; you can’t run this command now * 2045 Can’t open shared memory; no answer from server (%lu) * 2055 Lost connection to MySQL server at ‘%s’, system error: %d
from http://dev.mysql.com/doc/refman/5.6/en/error-messages-client.html
Converts IntegrityError 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.