dbfunctions

module for enabling non-persistentread/write access to the postgreSQL DB. All listeners of DB changes subscribed here.

Also provides listen and notify function for other processes interested in changes to openburst DB tables (observer pattern).

dbfunctions.connect_to_db()

! connects to the DB and returns the connection

dbfunctions.listen_and_notify(queue, table, event_name, event=None)

! listens for changes on a DB table notifies when changes happen. see: http://initd.org/psycopg/docs/advanced.html

dbfunctions.read_server_ip_port_from_db(servername)

! given the name of the server (e.g. “DEM”), the DB is updated with the given ip and port is returned

dbfunctions.remove_pcl_detections()

removes pcl detections

dbfunctions.remove_team_from_table(team, table)

! remove all rows of the given table for the given team

dbfunctions.write_server_start_to_db(servername, ip, port)

! given the name of the server (e.g. “DEM”), the DB is updated with the given ip