5.3.1 Dbms Objects

class Dbms( )
Creates a Dbms object. Dbms objects support basic operations on a database.

Dbms objects have the following methods:

begin( )
Begins a transaction on the database.

close( )
Closes the database object. It is safe to try to close a database object even if it is not open.

commit( )
Commits the current transaction.

compact( )
Compacts the database, reclaiming unused space in the database file.

create( dbname)
Creates a database with path dbname.

execute( query)
Executes an SQL query. On success, returns 0 if a DDL (SQL schema update) statement was executed. Returns the number of rows inserted, updated, or deleted, if a DML (SQL data update) statement was executed.

open( dbname)
Opens the database in file dbname. This should be a full Unicode path name, for example, u'c:\\foo.db'.

rollback( )
Rolls back the current transaction.

See About this document... for information on suggesting changes.