garfield.database Package

This module provides the basics of database connection handling and versioning.

class garfield.database.Database(callbacks=None)

Bases: object

load_config(config, config_section='database')
setup()
class garfield.database.TransactionContext(*sessions)

Bases: object

This context makes sure that the associated transaction is rolled back at its end. The database session is required to have autotransaction turned off.

class garfield.database.TypeDescriptionMixin

Bases: object

This mix-in class is intended for simple SQL tables mapped via SQLAlchemy, that contain a list of type ids. This class provides a description getter that allows object’s id to be translated into a human readable string. All that needs to be done by the target class is to override the _DESCRIPTIONS property.

class garfield.database.TypeDescriptionPluginMixin

Bases: garfield.database.TypeDescriptionMixin

This mix-in class extends TypeDescriptionMixin and loads the descriptions from dictionaries associated with the specified entry point _ENTRY_POINT_NAME.

garfield.database.build_description_url(dbhost, dbport, dbname)
garfield.database.check_has_patches(sess, patch_names)
garfield.database.enable_debugging()
garfield.database.escape_search_text(text)

Perform escaping of the search string. All characters sent through text will be searched for verbatim, without special meanings.

garfield.database.filter_reflection_warnings()
garfield.database.has_role(sess, role_name)
garfield.database.reflect_tables(meta, table_names, tables=None)
garfield.database.table_exists(sess, table_name)

Returns True in case table table_name exists in the database.