Module s.d.database

Part of stoqlib.database

Database access methods
Function drop_database Drops a database.
Function clean_database Cleans a database. If the database does not exist, it will be created.
Function execute_sql Inserts Raw SQL commands into the database read from a file.
Function dump_database Dump the contents of the current database
Function rename_database Renames a database.
Function restore_database Restores the current database.
Function dump_table Dump the contents of a table.
def drop_database(dbname):
Drops a database.
Parametersdbnamethe name of the database to be dropped.
def clean_database(dbname):
Cleans a database. If the database does not exist, it will be created.
Parametersdbnamename of the database.
def execute_sql(filename):
Inserts Raw SQL commands into the database read from a file.
Parametersfilenamefilename with SQL commands
Returnsreturn code, 0 if succeeded, positive integer for failure (type: int )
def dump_database(filename):
Dump the contents of the current database
Parametersfilenamefilename to write the database dump to
def rename_database(src, dest):
Renames a database.
Parameterssrcthe name of the database we want to rename.
destthe new database name.
def restore_database(dump):
Restores the current database.
Parametersdumpa database dump file to be used to restore the database.
def dump_table(table):
Dump the contents of a table. Note this does not include the schema itself, just the data. To get the data call stdout.read() on the returned object.
Parameterstabletable to write
proca subprocess.Popen instance
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.