init repo

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-05-14 12:06:15 +02:00
commit 72852f9355
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
8 changed files with 115 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@ -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/

28
README.md Normal file
View File

@ -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

0
analyses/.gitkeep Normal file
View File

23
dbt_project.yml Normal file
View File

@ -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

0
macros/.gitkeep Normal file
View File

56
models/schema.yml Normal file
View File

@ -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

0
seeds/.gitkeep Normal file
View File

0
tests/.gitkeep Normal file
View File