Package trac :: Package db :: Module api :: Class IDatabaseConnector

Class IDatabaseConnector

source code

    object --+    
             |    
core.Interface --+
                 |
                IDatabaseConnector

Extension point interface for components that support the connection to relational databases.
Instance Methods
 
get_supported_schemes()
Return the connection URL schemes supported by the connector, and their relative priorities as an iterable of (scheme, priority) tuples.
source code
 
get_connection(path, log=None, **kwargs)
Create a new connection to the database.
source code
 
get_exceptions()
Return an object (typically a module) containing all the backend-specific exception types as attributes, named according to the Python Database API (http://www.python.org/dev/peps/pep-0249/).
source code
 
init_db(path, schema=None, log=None, **kwargs)
Initialize the database.
source code
 
destroy_db(self, path, log=None, **kwargs)
Destroy the database.
source code
 
db_exists(self, path, log=None, **kwargs)
Return True if the database exists.
source code
 
to_sql(table)
Return the DDL statements necessary to create the specified table, including indices.
source code
 
backup(dest)
Backup the database to a location defined by trac.backup_dir
source code
 
get_system_info()
Yield a sequence of (name, version) tuples describing the name and version information of external packages used by the connector.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

get_supported_schemes()

source code 

Return the connection URL schemes supported by the connector, and their relative priorities as an iterable of (scheme, priority) tuples.

If priority is a negative number, this is indicative of an error condition with the connector. An error message should be attached to the error attribute of the connector.