Sample Tracking is a project aimed at managing and updating the SQL views of our warehouse. This repository contains SQL scripts and automation workflows to ensure that the warehouse views are kept up-to-date and accurate.
The apply.py
script can be used to update the databases. Run it with apply.py -h
to see usage notes. You may need to install the Python library mysql.connector
.
To save you having to input database passwords when you run the script, you can put your passwords into a config file passwords.ini
with the following format:
[uat]
password=uat_password
[prod]
password=prod_password
(but don't add the passwords file to the git repository)
views
folder. Where you have to refer to a database schema, use the following placeholders:
[reporting]
—the reporting schema[warehouse]
—the warehouse schema[events]
—the events schemaThe names that these refer to can be seen inside the env.ini
config file.
apply.py
script: ./apply.py --uat views/new_view.sql
apply.py
script: ./apply.py --prod views/new_view.sql