1.4.16.2 Connection Objects

Connection objects respond to the following methods as defined in the DB-API 2.0 close(), commit() and rollback(). The commit() and rollback() methods should work as specified in the DB-API 2.0. Even if the database engine doesn't directly support transactions, these facilities should be emulated.

Connection objects also have a cursor() method.

cursor( [execute=True], [format='tuple'], [convert=True], [mode='portable'])

The default values which the cursor abstraction methods will take for the values of execute, format and convert can be set using this method.

format
This can be 'tuple' to return the results as a tuples, 'text' to return as text wrapped to 80 characters for display in a terminal, 'dict' to return the results as dictionaries or 'object' to return the results as result objects to be treated as dictionaries, tuples or via attribute access.
convert
Convert the results to standard formats (should be True for most users)
execute
Used in the cursor SQL methods. If True then rather than returning an SQL string, the methods execute the results
mode
The default mode for the execute() method. Can be 'portable' to use the SQL abstraction methods or 'direct' to send the SQL directly to the underlying cursor.

Connection objects also have the following attributes:

tables
A dictionary of Table objects with their names as the keys
converters
A dictionary of field converter objects for all supported database types.
baseConnection
The DB-API 2.0 Connection object