Package bazaar :: Module motor :: Class Motor
[show private | hide private]
[frames | no frames]

Class Motor


Database access object.

The class depends od database API module - Python DB-API 2.0 in this case.
Method Summary
  __init__(self, dbmod)
Initialize database access object.
  add(self, query, data)
Insert row into database relation.
  closeDBConn(self)
Close database connection.
  commit(self)
Commit pending database transactions.
  connectDB(self, dsn)
Connect with database.
  delete(self, query, key)
Delete row from database relation.
  executeMany(self, query, data_list)
Execute batch query with list of data parameters.
  getData(self, query, param)
Get list of rows from database.
  rollback(self)
Rollback database transactions.
  update(self, query, data, key)
Update row in database relation.

Instance Variable Summary
  conn: Python DB API connection object.
  dbmod: Python DB API module.

Method Details

__init__(self, dbmod)
(Constructor)

Initialize database access object.
Parameters:
dbmod - DB-API 2.0 module.

add(self, query, data)

Insert row into database relation.
Parameters:
query - SQL query.
data - Row data to insert.

closeDBConn(self)

Close database connection.

See Also: bazaar.motor.Motor.connectDB

commit(self)

Commit pending database transactions.

connectDB(self, dsn)

Connect with database.
Parameters:
dsn - Data source name.

See Also: bazaar.motor.Motor.closeDBConn

delete(self, query, key)

Delete row from database relation.
Parameters:
query - SQL query.
key - Key of the row to delete.

executeMany(self, query, data_list)

Execute batch query with list of data parameters.
Parameters:
query - Query to execute.
data_list - List of query's data.

getData(self, query, param=None)

Get list of rows from database.

Method returns dictionary per database relation row. The dictionary keys are relation column names and dictionary values are column values of the relation row.
Parameters:
query - Database SQL query.

rollback(self)

Rollback database transactions.

update(self, query, data, key)

Update row in database relation.
Parameters:
query - SQL query.
data - Tuple of new values for the row.
key - Key of the row to update.

Instance Variable Details

conn

Python DB API connection object.

dbmod

Python DB API module.

Generated by Epydoc 2.0 on Tue Mar 23 14:53:30 2004 http://epydoc.sf.net