pyre.db.Postgres

Module Contents

class pyre.db.Postgres.Postgres

Bases: pyre.db.Server.Server

Component that manages the connection to a Postgres database

database
doc = the name of the database to connect to
username
doc = the database user name to use during authentication
password
doc = the password of the database user
application
doc = the application name to use for the connection
quiet
doc = control whether certain postgres informationals are shown
postgres
connection
attach(self)

Connect to the database

detach(self)

Close the connection to the database

Closing a connection makes it unsuitable for any further database access. This applies to all objects that may retain a reference to the connection being closed. Any uncommitted changes will be lost

execute(self, *sql)

Execute the sequence of SQL statements in {sql} as a single command

__enter__(self)

Hook invoked when the context manager is entered

__exit__(self, exc_type, exc_instance, exc_traceback)

Hook invoked when the context manager’s block exits