Skip to content

Commit

Permalink
dbt
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Nov 8, 2023
1 parent 67249cc commit 887e61b
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dbt/hivemapper/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

target/
dbt_packages/
logs/
1 change: 1 addition & 0 deletions .dbt/hivemapper/.user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
id: 88ca8884-af12-4f1a-8ba8-fe2bbf0c0a6d
15 changes: 15 additions & 0 deletions .dbt/hivemapper/README.md
Original file line number Diff line number Diff line change
@@ -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
Empty file.
37 changes: 37 additions & 0 deletions .dbt/hivemapper/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -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
Empty file added .dbt/hivemapper/macros/.gitkeep
Empty file.
19 changes: 19 additions & 0 deletions .dbt/hivemapper/models/example/fleet_count_model.sql
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions .dbt/hivemapper/models/example/schema.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions .dbt/hivemapper/profiles.yml
Original file line number Diff line number Diff line change
@@ -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
Empty file added .dbt/hivemapper/seeds/.gitkeep
Empty file.
Empty file.
Empty file added .dbt/hivemapper/tests/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions .dbt/profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
company-name:
target: dev
outputs:
dev:
type: postgres
host: localhost
user: dev
password: SecureMe!
port: 5433
dbname: hivemapper
schema: hivemapper
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
/honey-tracker
/.dbt/logs/dbt.log

0 comments on commit 887e61b

Please sign in to comment.