A wrapper around a DB 2.0 connection.
Provides a minimal but consistent interface to an underlying
database connection. In particular, a Connection quotes SQL
queries as necessary for the underlying DB 2.0 connection.
Methods
|
|
__init__
close
commit
execute
rollback
|
|
__init__
|
__init__ (
self,
module_name,
*args,
*more_args,
)
Uses the given DB 2.0 module to connect to a database.
-
module_name
- The DB 2.0-compliant module to use to connect,
for example "pgdb".
-
args
- Positional arguments to pass to the module's
connect
method.
-
more_args
- Keyword arguments to pass to the module's
connect method.
|
|
close
|
close ( self )
|
|
commit
|
commit ( self )
|
|
execute
|
execute ( self, sql )
Execute a SQL statement in this database.
If this database requires any overall quoting of the given SQL
(for instance, doubling of %'s), it will be performed by this
method.
- returns
- A database cursor.
|
|
rollback
|
rollback ( self )
|
|