Table Of Contents

Previous topic

ldap Package

Next topic

migrate_repo Package

This Page

sql Package

sql Package

core Module

SQL backends for the various services.

class keystone.common.sql.core.Base

Bases: object

get_engine()

Return a SQLAlchemy engine.

get_maker(engine, autocommit=True, expire_on_commit=False)

Return a SQLAlchemy sessionmaker using the given engine.

get_session(autocommit=True, expire_on_commit=False)

Return a SQLAlchemy session.

class keystone.common.sql.core.DictBase

Bases: object

get(key, default=None)
iteritems()

Make the model object behave like a dict.

Includes attributes from joins.

next()
to_dict()
update(values)

Make the model object behave like a dict.

class keystone.common.sql.core.JsonBlob(*args, **kwargs)

Bases: sqlalchemy.types.TypeDecorator

impl

alias of Text

process_bind_param(value, dialect)
process_result_value(value, dialect)
class keystone.common.sql.core.MySQLPingListener

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

checkout(dbapi_con, con_record, con_proxy)

legacy Module

class keystone.common.sql.legacy.LegacyMigration(db_string)

Bases: object

dump_catalog()

Generate the contents of a catalog templates file.

migrate_all()
keystone.common.sql.legacy.export_db(db)

migration Module

keystone.common.sql.migration.db_sync(version=None)
keystone.common.sql.migration.db_version()
keystone.common.sql.migration.db_version_control(version=None)

nova Module

Export data from Nova database and import through Identity Service.

keystone.common.sql.nova.import_auth(data)

util Module

keystone.common.sql.util.setup_test_database()