From 887e61b88b2e0c4673108b24f4cd5986fc980a6d Mon Sep 17 00:00:00 2001 From: billettc Date: Tue, 7 Nov 2023 21:16:52 -0500 Subject: [PATCH] dbt --- .dbt/hivemapper/.gitignore | 4 ++ .dbt/hivemapper/.user.yml | 1 + .dbt/hivemapper/README.md | 15 ++++++++ .dbt/hivemapper/analyses/.gitkeep | 0 .dbt/hivemapper/dbt_project.yml | 37 +++++++++++++++++++ .dbt/hivemapper/macros/.gitkeep | 0 .../models/example/fleet_count_model.sql | 19 ++++++++++ .dbt/hivemapper/models/example/schema.yml | 12 ++++++ .dbt/hivemapper/profiles.yml | 20 ++++++++++ .dbt/hivemapper/seeds/.gitkeep | 0 .dbt/hivemapper/snapshots/.gitkeep | 0 .dbt/hivemapper/tests/.gitkeep | 0 .dbt/profile.yml | 11 ++++++ .gitignore | 1 + 14 files changed, 120 insertions(+) create mode 100644 .dbt/hivemapper/.gitignore create mode 100644 .dbt/hivemapper/.user.yml create mode 100644 .dbt/hivemapper/README.md create mode 100644 .dbt/hivemapper/analyses/.gitkeep create mode 100644 .dbt/hivemapper/dbt_project.yml create mode 100644 .dbt/hivemapper/macros/.gitkeep create mode 100644 .dbt/hivemapper/models/example/fleet_count_model.sql create mode 100644 .dbt/hivemapper/models/example/schema.yml create mode 100644 .dbt/hivemapper/profiles.yml create mode 100644 .dbt/hivemapper/seeds/.gitkeep create mode 100644 .dbt/hivemapper/snapshots/.gitkeep create mode 100644 .dbt/hivemapper/tests/.gitkeep create mode 100644 .dbt/profile.yml diff --git a/.dbt/hivemapper/.gitignore b/.dbt/hivemapper/.gitignore new file mode 100644 index 0000000..49f147c --- /dev/null +++ b/.dbt/hivemapper/.gitignore @@ -0,0 +1,4 @@ + +target/ +dbt_packages/ +logs/ diff --git a/.dbt/hivemapper/.user.yml b/.dbt/hivemapper/.user.yml new file mode 100644 index 0000000..73c0708 --- /dev/null +++ b/.dbt/hivemapper/.user.yml @@ -0,0 +1 @@ +id: 88ca8884-af12-4f1a-8ba8-fe2bbf0c0a6d diff --git a/.dbt/hivemapper/README.md b/.dbt/hivemapper/README.md new file mode 100644 index 0000000..7874ac8 --- /dev/null +++ b/.dbt/hivemapper/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 [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/.dbt/hivemapper/analyses/.gitkeep b/.dbt/hivemapper/analyses/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.dbt/hivemapper/dbt_project.yml b/.dbt/hivemapper/dbt_project.yml new file mode 100644 index 0000000..b5a6f59 --- /dev/null +++ b/.dbt/hivemapper/dbt_project.yml @@ -0,0 +1,37 @@ + +# 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: 'hivemapper' +version: '1.0.0' +config-version: 2 + +# This setting configures which "profile" dbt uses for this project. +profile: 'hivemapper' + +# These configurations specify where dbt should look for different types of files. +# The `model-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"] + +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 views. These settings can be overridden in the individual model +# files using the `{{ config(...) }}` macro. +models: + hivemapper: + # Config indicated by + and applies to all files under models/example/ + example: + +materialized: view diff --git a/.dbt/hivemapper/macros/.gitkeep b/.dbt/hivemapper/macros/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.dbt/hivemapper/models/example/fleet_count_model.sql b/.dbt/hivemapper/models/example/fleet_count_model.sql new file mode 100644 index 0000000..87c3758 --- /dev/null +++ b/.dbt/hivemapper/models/example/fleet_count_model.sql @@ -0,0 +1,19 @@ + +/* + 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') }} + +select count(*) as fleet_count +from hivemapper.fleets + +/* + Uncomment the line below to remove records with null `id` values +*/ + +-- where id is not null diff --git a/.dbt/hivemapper/models/example/schema.yml b/.dbt/hivemapper/models/example/schema.yml new file mode 100644 index 0000000..3123670 --- /dev/null +++ b/.dbt/hivemapper/models/example/schema.yml @@ -0,0 +1,12 @@ + +version: 2 + +models: + - name: dbt_fleet_count + description: "Fleet Count" + columns: + - name: fleet_count + description: "The count" + tests: + - unique + - not_null \ No newline at end of file diff --git a/.dbt/hivemapper/profiles.yml b/.dbt/hivemapper/profiles.yml new file mode 100644 index 0000000..d8ff577 --- /dev/null +++ b/.dbt/hivemapper/profiles.yml @@ -0,0 +1,20 @@ +hivemapper: + outputs: + dev: + type: postgres + host: localhost + user: dev + password: SecureMe! + port: 5433 + dbname: hivemapper + schema: hivemapper + prod: + type: postgres + host: localhost + user: dev + password: SecureMe! + port: 5433 + dbname: hivemapper + schema: hivemapper + + target: dev diff --git a/.dbt/hivemapper/seeds/.gitkeep b/.dbt/hivemapper/seeds/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.dbt/hivemapper/snapshots/.gitkeep b/.dbt/hivemapper/snapshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.dbt/hivemapper/tests/.gitkeep b/.dbt/hivemapper/tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.dbt/profile.yml b/.dbt/profile.yml new file mode 100644 index 0000000..486c75e --- /dev/null +++ b/.dbt/profile.yml @@ -0,0 +1,11 @@ +company-name: + target: dev + outputs: + dev: + type: postgres + host: localhost + user: dev + password: SecureMe! + port: 5433 + dbname: hivemapper + schema: hivemapper diff --git a/.gitignore b/.gitignore index 118a3b3..703a452 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea /honey-tracker +/.dbt/logs/dbt.log