Skip to content

Commit e9281bf

Browse files
author
Stephen Barrie
committed
initial commit
1 parent 08ff29e commit e9281bf

File tree

10 files changed

+96
-0
lines changed

10 files changed

+96
-0
lines changed

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
target/
3+
dbt_packages/
4+
logs/

Diff for: analyses/.gitkeep

Whitespace-only changes.

Diff for: dbt_project.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
# Name your project! Project names should contain only lowercase characters
3+
# and underscores. A good package name should reflect your organization's
4+
# name or the intended use of these models
5+
name: 'my_new_project'
6+
version: '1.0.0'
7+
config-version: 2
8+
9+
# This setting configures which "profile" dbt uses for this project.
10+
profile: 'default'
11+
12+
# These configurations specify where dbt should look for different types of files.
13+
# The `source-paths` config, for example, states that models in this project can be
14+
# found in the "models/" directory. You probably won't need to change these!
15+
model-paths: ["models"]
16+
analysis-paths: ["analyses"]
17+
test-paths: ["tests"]
18+
seed-paths: ["seeds"]
19+
macro-paths: ["macros"]
20+
snapshot-paths: ["snapshots"]
21+
22+
target-path: "target" # directory which will store compiled SQL files
23+
clean-targets: # directories to be removed by `dbt clean`
24+
- "target"
25+
- "dbt_packages"
26+
27+
28+
# Configuring models
29+
# Full documentation: https://docs.getdbt.com/docs/configuring-models
30+
31+
# In this example config, we tell dbt to build all models in the example/ directory
32+
# as tables. These settings can be overridden in the individual model files
33+
# using the `{{ config(...) }}` macro.
34+
models:
35+
my_new_project:
36+
# Applies to all files under models/example/
37+
example:
38+
materialized: view

Diff for: macros/.gitkeep

Whitespace-only changes.

Diff for: models/example/my_first_dbt_model.sql

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
/*
3+
Welcome to your first dbt model!
4+
Did you know that you can also configure models directly within SQL files?
5+
This will override configurations stated in dbt_project.yml
6+
7+
Try changing "table" to "view" below
8+
*/
9+
10+
{{ config(materialized='table') }}
11+
12+
with source_data as (
13+
14+
select 1 as id
15+
union all
16+
select null as id
17+
18+
)
19+
20+
select *
21+
from source_data
22+
23+
/*
24+
Uncomment the line below to remove records with null `id` values
25+
*/
26+
27+
-- where id is not null

Diff for: models/example/my_second_dbt_model.sql

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
-- Use the `ref` function to select from other models
3+
4+
select *
5+
from {{ ref('my_first_dbt_model') }}
6+
where id = 1

Diff for: models/example/schema.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
version: 2
3+
4+
models:
5+
- name: my_first_dbt_model
6+
description: "A starter dbt model"
7+
columns:
8+
- name: id
9+
description: "The primary key for this table"
10+
tests:
11+
- unique
12+
- not_null
13+
14+
- name: my_second_dbt_model
15+
description: "A starter dbt model"
16+
columns:
17+
- name: id
18+
description: "The primary key for this table"
19+
tests:
20+
- unique
21+
- not_null

Diff for: seeds/.gitkeep

Whitespace-only changes.

Diff for: snapshots/.gitkeep

Whitespace-only changes.

Diff for: tests/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)