Skip to content

medic/cht-pipeline

Repository files navigation

CHT Pipeline

CHT Pipeline is a set of SQL queries that transform raw CouchDB data into a more useful format. It uses dbt to define the models that are translated into PostgreSQL tables or views, which makes it easier to query the data in the analytics platform of choice.

Local Setup

Follow the instructions in the Local CHT Sync Setup documentation to set up CHT Sync with CHT Pipeline locally.

Run dbt models unit tests locally

Prerequisites

  • Docker
  • (Optional) PostgreSQL Client

Run the tests

  1. Navigate to tests folder.
  2. Run the setup script:
# Set environment variables, create postgres database, schema and user:
./setup.sh
  1. Run the dbt tests:
# set environment variables, install dbt dependencies, seed data, run dbt, run test
./run_dbt_tests.sh
  1. Check for test coverage:
# Run dbt run-operation required_tests command
./check_tests_coverage.sh
  1. Clean up:
./tear_down.sh

About

CHT Pipeline is a tool used to define data models for transforming the raw data we get from Couch DB into models that can then be queried to build dashboards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages