Class s.d.s.DatabaseSettings(object):

Part of stoqlib.database.settings View In Hierarchy

DatabaseSettings contains all the information required to connect to a database, such as hostname, username and password.

It also provides helpers on top of ORMObject to return a database connection using the settings inside the object.

Method __init__ Undocumented
Method _build_uri Undocumented
Method _get_connection_internal Undocumented
Method get_connection_uri Returns a uri representing the current database settings.
Method get_connection Returns a connection to the configured database
Method get_default_connection Returns a connection to the default database, note that this
Method check_database_address Undocumented
Method has_database Checks if the database specified in the settings exists
def __init__(self, rdbms=DEFAULT_RDBMS, address=None, port=5432, dbname='stoq', username=None, password=''):
Undocumented
def _build_uri(self, dbname, filter_password=False):
Undocumented
def _get_connection_internal(self, dbname):
Undocumented
def get_connection_uri(self):
Returns a uri representing the current database settings. It's used by the orm to connect to a database.
Returnsa string like postgresql://username@localhost/dbname
def get_connection(self):
Returns a connection to the configured database
Returnsa database connection
def get_default_connection(self):
Returns a connection to the default database, note that this different from the configred. This method is mainly here to able to create other databases, which will need a connection, Be careful when using this method.
Returnsa database connection
def check_database_address(self):
Undocumented
def has_database(self):
Checks if the database specified in the settings exists
Returnsif the database exists
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.