Class e.c.d.DBBackend(log.Loggable):

Part of elisa.core.db_backend View In Hierarchy

Python DB API 2.0 backend support.

In addition to DB API 2.0 support this class implements an SQL query filter, based on a set of rules (which remain to be defined...)

Components can alter the database by adding new tables in the schema. These new tables can only be accessed via raw SQL queries.

Unknown Field: todoWe need to define a set of rules that specify which component can alter/insert data in core_tables.
Line # Kind Name Docs
79 Method __init__ Connect to a db backend hosting the given database.
135 Method disconnect Commit changes to the database and disconnect.
142 Method connect Connect to the database, set _db instance variable.
151 Method reconnect Disconnect and reconnect to the database.
158 Method save_changes Commit changes to the database
173 Method insert Execute an INSERT SQL query in the db backend
206 Method sql_execute Execute a SQL query in the db backend
277 Method table_columns Introspect given table and retrieve its column names in a cache
104 Method _init_backend Undocumented
221 Method _query Undocumented
255 Method _fix_params Undocumented
def __init__(self, **config):
Connect to a db backend hosting the given database.
Parametersusernamethe user name to use to connect to the database (type: string or None if no username required by backend )
passwordthe password to use to connect to the database (type: string or None if no password required by backend )
hostnamethe host name to connect to if the backend runs on a specific machine (type: string or None if no hostname required by backend )
RaisesDBBackendErrorWhen no db backend has been specified or if it cannot be used.
def _init_backend(self, backend_name):
Undocumented
def disconnect(self):
Commit changes to the database and disconnect.
def connect(self):
Connect to the database, set _db instance variable.
def reconnect(self):
Disconnect and reconnect to the database.
def save_changes(self):
Commit changes to the database
RaisesExceptionif the save has failed
def insert(self, sql_query, *params):
Execute an INSERT SQL query in the db backend and return the ID fo the row if AUTOINCREMENT is used
Parameterssql_querythe SQL query data to execute (type: string )
Returns (type: int )
def sql_execute(self, sql_query, *params, **kw):
Execute a SQL query in the db backend
Parameterssql_querythe SQL query data to execute (type: string )
Returns (type: elisa.extern.db_row.DBRow list )
def _query(self, request, *params, **keywords):
Undocumented
def _fix_params(self, params):
Undocumented
def table_columns(self, table_name):
Introspect given table and retrieve its column names in a cache

The cache is global to the module, not DBBackend instance specific.

Parameterstable_namename of the db table to introspect (type: string )
Returns (type: string list )
API Documentation for Elisa Media Center, generated by pydoctor at 2009-02-16 19:15:05.