Database Creation

Creates database tables, functions, and triggers.

database.createdb.create(conn, params, safe=False)[source]

Creates new tables and triggers for the connected PostgreSQL database by dropping tables if they exist. The current user must own the tables or be a superuser in order to drop them. USE WITH CAUTION! DELETING THE DATA CANNOT BE UNDONE.

Parameters:
  • conn (psycopg2.extensions.connect instance) – The PostgreSQL database connection object.
  • params (dict) – Dictionary of quality check requirements from the run configuration file.
  • safe (bool, optional) – If False, the user will be warned that existing data is about to be deleted and prompted to continue. Default value is False.
database.createdb.make_error(cur, params)[source]

Inserts values into the database error table.