data

All resources involved in data analytics

Setup and Usage of deploy_views.py

Initial Setup

  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:
source venv/bin/activate  # On Unix/macOS
# or
.\venv\Scripts\activate  # On Windows
  1. Install required packages:
pip install -r requirements.txt

Usage

The deploy_views.py script can be used in three ways:

  1. List all SQL files that would be processed (without making changes):
python scripts/deploy_views.py --list
  1. Deploy a specific view:
python scripts/deploy_views.py --target view_name
# or with .sql extension
python scripts/deploy_views.py --target view_name.sql
  1. Deploy all views:
python scripts/deploy_views.py

Important Notes

  • Always ensure the virtual environment is activated before running the script (you'll see (venv) in your terminal prompt)
  • The script requires a .env file with the following variables:
    • POSTGRES_HOST
    • POSTGRES_PORT
    • POSTGRES_DB
    • POSTGRES_USER
    • POSTGRES_PASSWORD
Description
All resources involved in data analytics
Readme 97 KiB
Languages
SQL 100%