Package backend :: Package server :: Package rhnSQL :: Module driver_postgresql :: Class Database
[hide private]
[frames] | no frames]

Class Database

source code


Class for PostgreSQL database operations.

Nested Classes [hide private]

Inherited from sql_base.Database (private): _procedure_class

Instance Methods [hide private]
 
__init__(self, host=None, port=None, username=None, password=None, database=None, sslmode=None, sslrootcert=None) source code
 
connect(self, reconnect=1)
Opens a connection to the database.
source code
 
is_connected_to(self, backend, host, port, username, password, database, sslmode, sslrootcert)
Check if this database matches the given connection parameters.
source code
 
check_connection(self)
Check that this connection is still valid.
source code
 
prepare(self, sql, force=0, blob_map=None)
Prepare an SQL statement.
source code
 
execute(self, sql, *args, **kwargs) source code
 
transaction(self, name)
set a transaction point to which we can rollback to
source code
 
commit(self)
Commit changes
source code
 
rollback(self, name=None)
rollback changes, optionally to a previously set transaction point
source code
 
procedure(self, name)
Return a pointer to a callable instance for a given stored procedure.
source code
 
_function(self, name, ret_type) source code
 
cursor(self)
return an empty Cursor object
source code
 
_read_lob(self, lob)
Reads a lob's contents
source code

Inherited from sql_base.Database: Date, DateFromTicks, close, function

Inherited from sql_base.Database (private): _fix_environment_vars

Class Variables [hide private]

Inherited from sql_base.Database: TimestampFromTicks

Method Details [hide private]

__init__(self, host=None, port=None, username=None, password=None, database=None, sslmode=None, sslrootcert=None)
(Constructor)

source code 
Overrides: sql_base.Database.__init__

connect(self, reconnect=1)

source code 

Opens a connection to the database.

Overrides: sql_base.Database.connect
(inherited documentation)

is_connected_to(self, backend, host, port, username, password, database, sslmode, sslrootcert)

source code 

Check if this database matches the given connection parameters.

Overrides: sql_base.Database.is_connected_to
(inherited documentation)

check_connection(self)

source code 

Check that this connection is still valid.

Overrides: sql_base.Database.check_connection
(inherited documentation)

prepare(self, sql, force=0, blob_map=None)

source code 

Prepare an SQL statement.

Overrides: sql_base.Database.prepare
(inherited documentation)

transaction(self, name)

source code 

set a transaction point to which we can rollback to

Overrides: sql_base.Database.transaction
(inherited documentation)

commit(self)

source code 

Commit changes

Overrides: sql_base.Database.commit
(inherited documentation)

rollback(self, name=None)

source code 

rollback changes, optionally to a previously set transaction point

Overrides: sql_base.Database.rollback
(inherited documentation)

procedure(self, name)

source code 

Return a pointer to a callable instance for a given stored procedure. The return value is a (possibly modified) copy of the arguments passed in. see cx_Oracle's Cursor.callproc for more details

Overrides: sql_base.Database.procedure
(inherited documentation)

_function(self, name, ret_type)

source code 
Overrides: sql_base.Database._function

cursor(self)

source code 

return an empty Cursor object

Overrides: sql_base.Database.cursor
(inherited documentation)

_read_lob(self, lob)

source code 

Reads a lob's contents

Overrides: sql_base.Database._read_lob
(inherited documentation)