From 72852f93555dd7e9517feb03a7e1d240f9f34e8b Mon Sep 17 00:00:00 2001 From: Alexis Pentori Date: Tue, 14 May 2024 12:06:15 +0200 Subject: [PATCH] init repo Signed-off-by: Alexis Pentori --- .gitignore | 8 +++++++ README.md | 28 ++++++++++++++++++++++++ analyses/.gitkeep | 0 dbt_project.yml | 23 +++++++++++++++++++ macros/.gitkeep | 0 models/schema.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++++ seeds/.gitkeep | 0 tests/.gitkeep | 0 8 files changed, 115 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 analyses/.gitkeep create mode 100644 dbt_project.yml create mode 100644 macros/.gitkeep create mode 100644 models/schema.yml create mode 100644 seeds/.gitkeep create mode 100644 tests/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a78194c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# you shouldn't commit these into source control +# these are the default directory names, adjust/add to fit your needs +target/ +dbt_packages/ +logs/ + +# legacy -- renamed to dbt_packages in v1 +dbt_modules/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..52b0115 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# DBT Models for Airbyte + +This directory contains the model used on the airbyte synchronization of the Hasura Database/ + +## Usage + +To use this repo, a `profiles.yml` with the data warehouse credentials must be in the directory `$HOME/.dbt/` of the user, or its path has to be indicated with `--profile-dir`. + + +This directory requires the package [dbt-postgres](https://docs.getdbt.com/docs/core/connect-data-platform/postgres-setup). + +The following commands can be used : + +- To build the project : `dbt build` +- To run the project : `dbt run` +- To test the project: `dbt test` + +### development + +Each new models can be test on the `test` environment of [infra-bi](https://github.com/status-im/infra-bi) by merging it into the `test` branch of this repo. Once the tests are conclusive, the `test` branch can me merge into the `prod` one. + +## Resources: + +- Learn more about dbt [in the docs](https://docs.getdbt.com/docs/introduction) +- Check out [Discourse](https://discourse.getdbt.com/) for commonly asked questions and answers +- Join the [chat](https://community.getdbt.com/) on Slack for live discussions and support +- Find [dbt events](https://events.getdbt.com) near you +- Check out [the blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices diff --git a/analyses/.gitkeep b/analyses/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/dbt_project.yml b/dbt_project.yml new file mode 100644 index 0000000..2be34c2 --- /dev/null +++ b/dbt_project.yml @@ -0,0 +1,23 @@ + +name: 'airbyte' +version: '1.0.0' +config-version: 2 + +profile: 'postgres' + +model-paths: ["models"] +analysis-paths: ["analyses"] +test-paths: ["tests"] +seed-paths: ["seeds"] +macro-paths: ["macros"] +snapshot-paths: ["snapshots"] + +clean-targets: # directories to be removed by `dbt clean` + - "target" + - "dbt_packages" + +models: + airbyte: + +materialized: table + +schema: public + diff --git a/macros/.gitkeep b/macros/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/models/schema.yml b/models/schema.yml new file mode 100644 index 0000000..7ecdcbb --- /dev/null +++ b/models/schema.yml @@ -0,0 +1,56 @@ +version: 2 + +models: + - name: public.gh_issues + config: + contract: + enforced: true + columns: + - name: id + data_type: bigint + constraints: + - type: primary_key + - name: assignee + data_type: TEXT + - name: author + data_type: TEXT + - name: stage + data_type: TEXT + - name: issue_url + data_type: TEXT + - name: title + data_type: TEXT + - name: repository + data_type: TEXT + - name: issue_number + data_type: bigint + - name: labels + data_type: JSONB + - name: closed_at + data_type: TIMESTAMP WITH TIME ZONE + - name: created_at + data_type: TIMESTAMP WITH TIME ZONE + - name: public.gh_issue_labels + config: + contract: + enforced: true + columns: + - name: id + data_type: BIGINT + - name: issue_id + data_type: BIGINT + constraints: + - type: foreign_key + expression: gh_issues (id) + - name: color + data_type: TEXT + - name: '"default"' + data_type: TEXT + - name: description + data_type: TEXT + - name: name + data_type: TEXT + - name: node_id + data_type: TEXT + - name: url + data_type: TEXT diff --git a/seeds/.gitkeep b/seeds/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/.gitkeep b/tests/.gitkeep new file mode 100644 index 0000000..e69de29