diff --git a/transform/.gitignore b/transform/.gitignore new file mode 100644 index 00000000..49f147cb --- /dev/null +++ b/transform/.gitignore @@ -0,0 +1,4 @@ + +target/ +dbt_packages/ +logs/ diff --git a/transform/README.md b/transform/README.md new file mode 100644 index 00000000..13040c04 --- /dev/null +++ b/transform/README.md @@ -0,0 +1,15 @@ +Welcome to your new dbt project! + +### Using the starter project + +Try running the following commands: +- dbt run +- dbt test + + +### 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 [dbt community](http://community.getbdt.com/) to learn from other analytics engineers +- 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/transform/analyses/.gitkeep b/transform/analyses/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/transform/dbt_project.yml b/transform/dbt_project.yml new file mode 100644 index 00000000..26771cc0 --- /dev/null +++ b/transform/dbt_project.yml @@ -0,0 +1,38 @@ + +# Name your project! Project names should contain only lowercase characters +# and underscores. A good package name should reflect your organization's +# name or the intended use of these models +name: 'my_new_project' +version: '1.0.0' +config-version: 2 + +# This setting configures which "profile" dbt uses for this project. +profile: 'default' + +# These configurations specify where dbt should look for different types of files. +# The `source-paths` config, for example, states that models in this project can be +# found in the "models/" directory. You probably won't need to change these! +model-paths: ["models"] +analysis-paths: ["analyses"] +test-paths: ["tests"] +seed-paths: ["seeds"] +macro-paths: ["macros"] +snapshot-paths: ["snapshots"] + +target-path: "target" # directory which will store compiled SQL files +clean-targets: # directories to be removed by `dbt clean` + - "target" + - "dbt_packages" + + +# Configuring models +# Full documentation: https://docs.getdbt.com/docs/configuring-models + +# In this example config, we tell dbt to build all models in the example/ directory +# as tables. These settings can be overridden in the individual model files +# using the `{{ config(...) }}` macro. +models: + my_new_project: + # Applies to all files under models/example/ + example: + materialized: view diff --git a/transform/macros/.gitkeep b/transform/macros/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/transform/models/example/my_first_dbt_model.sql b/transform/models/example/my_first_dbt_model.sql new file mode 100644 index 00000000..f31a12d9 --- /dev/null +++ b/transform/models/example/my_first_dbt_model.sql @@ -0,0 +1,27 @@ + +/* + Welcome to your first dbt model! + Did you know that you can also configure models directly within SQL files? + This will override configurations stated in dbt_project.yml + + Try changing "table" to "view" below +*/ + +{{ config(materialized='table') }} + +with source_data as ( + + select 1 as id + union all + select null as id + +) + +select * +from source_data + +/* + Uncomment the line below to remove records with null `id` values +*/ + +-- where id is not null diff --git a/transform/models/example/my_second_dbt_model.sql b/transform/models/example/my_second_dbt_model.sql new file mode 100644 index 00000000..c91f8793 --- /dev/null +++ b/transform/models/example/my_second_dbt_model.sql @@ -0,0 +1,6 @@ + +-- Use the `ref` function to select from other models + +select * +from {{ ref('my_first_dbt_model') }} +where id = 1 diff --git a/transform/models/example/schema.yml b/transform/models/example/schema.yml new file mode 100644 index 00000000..8dee3090 --- /dev/null +++ b/transform/models/example/schema.yml @@ -0,0 +1,21 @@ + +version: 2 + +models: + - name: my_first_dbt_model + description: "A starter dbt model" + columns: + - name: id + description: "The primary key for this table" + tests: + - unique + - not_null + + - name: my_second_dbt_model + description: "A starter dbt model" + columns: + - name: id + description: "The primary key for this table" + tests: + - unique + - not_null diff --git a/transform/seeds/.gitkeep b/transform/seeds/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/transform/snapshots/.gitkeep b/transform/snapshots/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/transform/tests/.gitkeep b/transform/tests/.gitkeep new file mode 100644 index 00000000..e69de29b