4.13.1Class DBIDataManager

Data manager interfacing DBI connections.

Class DBIDataManager( name, loc ) from \
                 DataManager(( name, loc))

This class is not meant for direct usage. You should primarily use the entity interfaces, the database related services and ultimately the dabase handler.

However, the functions provided by this class may be directly used, but this will reduce the data abstraction of your web application.

It's safe to use the DBIDataManager.dbc handler to perform directly SQL statements, but this will cause an even more tight coupling of the database logic with your web application, and should be avoided when possible.

Properties
columnsTitle of the columns of the last query operation
csConnection string
Methods
createEntityCreates an entity in the database. Called back by DataManager.create.
deleteUpdates the required data in the database.
insertInserts the required data in the given database table.
updateUpdates the required data in the database.

Properties

columns

Title of the columns of the last query operation

cs

Connection string

Methods

createEntity

Creates an entity in the database. Called back by DataManager.create.

createEntity( entity, cond )
entity The DBEntity to be created in the database.
cond True to create only if the table doesn't exist.

delete

Updates the required data in the database.

delete( table, key_fields, data, entity )
table The table to be accessed in the database.
key_fields A dictionary of field => value to be used as where condition, possibly uniquely identifying a single record.
data A dictionary of field => value pairs to be updated to the database.
ReturnNumber of affected rows.

insert

Inserts the required data in the given database table.

insert( entity, data )
entity The table to be accessed in the database.
data A dictionary of field => value pairs to be added to the database.

If the table has an automatic ID generator as the primary key, this will be detected and the coresponding key field will be updated in the input data parameter.

update

Updates the required data in the database.

update( entity, key_fields, data )
entity The table to be accessed in the database.
key_fields A dictionary of field => value to be used as where condition, possibly uniquely identifying a single record.
data A dictionary of field => value pairs to be updated to the database.
ReturnNumber of affected rows.
Made with http://www.falconpl.org