mirror of
https://github.com/SyncrowIOT/data.git
synced 2025-07-09 22:57:19 +00:00
cd-test
data
All resources involved in data analytics
Setup and Usage of deploy_views.py
Initial Setup
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate # On Unix/macOS
# or
.\venv\Scripts\activate # On Windows
- Install required packages:
pip install -r requirements.txt
Usage
The deploy_views.py
script can be used in three ways:
- List all SQL files that would be processed (without making changes):
python scripts/deploy_views.py --list
- 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
- 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
Languages
SQL
100%