|
5 | 5 | - More control over how models are materialized
|
6 | 6 | - Minor improvements
|
7 | 7 | - Bugfixes
|
| 8 | + - Connor McArthur |
8 | 9 |
|
9 | 10 | ### Macros
|
10 | 11 |
|
@@ -50,11 +51,48 @@ dbt run --help
|
50 | 51 |
|
51 | 52 | ### Minor improvements [more info](https://github.com/analyst-collective/dbt/milestone/15?closed=1)
|
52 | 53 |
|
53 |
| - - Add `{{ target }}` variable to dbt runtime [more info](https://github.com/analyst-collective/dbt/issues/149) |
54 |
| - - User-specified `profiles.yml` dir [more info](https://github.com/analyst-collective/dbt/issues/213) |
55 |
| - - Add timestamp to console output [more info](https://github.com/analyst-collective/dbt/issues/125) |
56 |
| - - Run dbt from subdirectory of project root [more info](https://github.com/analyst-collective/dbt/issues/129) |
57 |
| - - Pre and post run hooks [more info](https://github.com/analyst-collective/dbt/issues/226) |
| 54 | +#### Add a `{{ target }}` variable to the dbt runtime [more info](https://github.com/analyst-collective/dbt/issues/149) |
| 55 | +Use `{{ target }}` to interpolate profile variables into your model definitions. For example: |
| 56 | + |
| 57 | +```sql |
| 58 | +-- only use the last week of data in development |
| 59 | +select * from events |
| 60 | + |
| 61 | +{% if target.name == 'dev' %} |
| 62 | +where created_at > getdate() - interval '1 week' |
| 63 | +{% endif %} |
| 64 | +``` |
| 65 | + |
| 66 | +#### User-specified `profiles.yml` dir [more info](https://github.com/analyst-collective/dbt/issues/213) |
| 67 | +DBT looks for a file called `profiles.yml` in the `~/.dbt/` directory. You can now overide this directory with |
| 68 | +```bash |
| 69 | +$ dbt run --profiles-dir /path/to/my/dir |
| 70 | +``` |
| 71 | +#### Add timestamp to console output [more info](https://github.com/analyst-collective/dbt/issues/125) |
| 72 | +Informative _and_ pretty |
| 73 | + |
| 74 | +#### Run dbt from subdirectory of project root [more info](https://github.com/analyst-collective/dbt/issues/129) |
| 75 | +A story in three parts: |
| 76 | +```bash |
| 77 | +cd models/snowplow/sessions |
| 78 | +vim sessions.sql |
| 79 | +dbt run # it works! |
| 80 | +``` |
| 81 | + |
| 82 | +#### Pre and post run hooks [more info](https://github.com/analyst-collective/dbt/issues/226) |
| 83 | +```yaml |
| 84 | +# dbt_project.yml |
| 85 | +name: ... |
| 86 | +version: ... |
| 87 | + |
| 88 | +... |
| 89 | + |
| 90 | +# supply either a string, or a list of strings |
| 91 | +on-run-start: "create table public.cool_table (id int)" |
| 92 | +on-run-end: |
| 93 | + - insert into public.cool_table (id) values (1), (2), (3) |
| 94 | + - insert into public.cool_table (id) values (4), (5), (6) |
| 95 | +``` |
58 | 96 |
|
59 | 97 | ### Bug fixes https://github.com/analyst-collective/dbt/milestone/11?closed=1
|
60 | 98 |
|
|
0 commit comments