Package BioSQL :: Module BioSeqDatabase :: Class DBServer
[hide private]
[frames] | no frames]

Class DBServer

source code

Represents a BioSQL database continaing namespaces (sub-databases).

This acts like a Python dictionary, giving access to each namespace
(defined by a row in the biodatabase table) as a BioSeqDatabase object.

Instance Methods [hide private]
 
__init__(self, conn, module, module_name=None) source code
 
__repr__(self) source code
 
__getitem__(self, name) source code
 
__len__(self)
Number of namespaces (sub-databases) in this database.
source code
 
__contains__(self, value)
Check if a namespace (sub-database) in this database.
source code
 
__iter__(self)
Iterate over namespaces (sub-databases) in the database.
source code
 
iterkeys(self)
Iterate over namespaces (sub-databases) in the database.
source code
 
itervalues(self)
Iterate over BioSeqDatabase objects in the database.
source code
 
iteritems(self)
Iterate over (namespace, BioSeqDatabase) in the database.
source code
 
keys(self)
List of namespaces (sub-databases) in the database.
source code
 
values(self)
List of BioSeqDatabase objects in the database.
source code
 
items(self)
List of (namespace, BioSeqDatabase) for entries in the database.
source code
 
__delitem__(self, name)
Remove a namespace and all its entries.
source code
 
remove_database(self, db_name)
Remove a namespace and all its entries (OBSOLETE).
source code
 
new_database(self, db_name, authority=None, description=None)
Add a new database to the server and return it.
source code
 
load_database_sql(self, sql_file)
Load a database schema into the given database.
source code
 
commit(self)
Commits the current transaction to the database.
source code
 
rollback(self)
Rolls backs the current transaction.
source code
 
close(self)
Close the connection.
source code
Method Details [hide private]

remove_database(self, db_name)

source code 
Remove a namespace and all its entries (OBSOLETE).

Try to remove all references to items in a database.

server.remove_database(name)

In keeping with the dictionary interface, you can now do this:

del server[name]

load_database_sql(self, sql_file)

source code 
Load a database schema into the given database.

This is used to create tables, etc when a database is first created.
sql_file should specify the complete path to a file containing
SQL entries for building the tables.

close(self)

source code 
Close the connection. No further activity possible.