OpenmolarDatabase
Incomplete documentation - sorry!
Note
Neil - please put some data in technical/class_headings/OpenmolarDatabase.rst
methods and attributes
-
class lib_openmolar.common.qt4.postgres.openmolar_database.OpenmolarDatabase(connection_data)[source]
Bases: PyQt4.QtSql.QSqlDatabase
inherits from PyQt4.QSql.QSqlDatabase
adds a function “connect”, which opens the connection whilst
using a qt wait cursor.
Will Raise a Connection error if connection has not been established
within 10 seconds
-
__init__(connection_data)[source]
-
exception SchemaVersionError[source]
Bases: exceptions.Exception
-
OpenmolarDatabase.connect(*args)[source]
open the connection, raising an error if fails or timeouts
optional arguments of (user, password)
-
OpenmolarDatabase.description[source]
databasename, host and port
-
OpenmolarDatabase.emit_notification(notification)[source]
send a notify query to the database so that clients can communicate.
NB - notification events are more likely to come via triggers in the
database itself.
-
OpenmolarDatabase.notification_received(notification, payload=None)[source]
the database has emitted a notify signal with text notification
that we are subscribed to.
we emit a qt signal, that should be connected by any application.
-
OpenmolarDatabase.schema_version[source]
poll the database to get the schema version from settings table
-
OpenmolarDatabase.subscribeToNotifications()[source]
this should be overwritten when this connection is implemented
postgres can emit signals when the database is changed by another
client.
the query is simple
NOTIFY appointments_changed