Skip to content

Commit

Permalink
docs: update README with the id macro changes
Browse files Browse the repository at this point in the history
- add a note that generate_id macro will be deprecated
- add the description for the new id macro
  • Loading branch information
JasperSelmanUiPath committed Oct 5, 2023
1 parent b7b07ff commit 6235515
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This dbt package contains macros for SQL functions to run the dbt project on mul
- [date_from_timestamp](#date_from_timestamp-source)
- [datediff](#datediff-source)
- [generate_id](#generate_id-source)
- [id](#id-source)
- [min_boolean](#min_boolean-source)
- [string_agg](#string_agg-source)
- [timestamp_from_date](#timestamp_from_date-source)
Expand Down Expand Up @@ -103,6 +104,8 @@ Usage:
`{{ pm_utils.datediff('[datepart]', '[start_date_expression]', '[end_date_expression]') }}`

#### generate_id ([source](macros/multiple_databases/generate_id.sql))
**Note:** this macro is deprecated and will be removed in a future release. To create an ID, the `id()` macro should be used.

This macro generates an id field for the current model. This macro can only be used in a dbt post-hook. With the argument you specify the name of the id field which can be referenced in next transformations like any other field.

Usage:
Expand All @@ -112,6 +115,12 @@ Usage:
) }}
```

#### id ([source](macros/multiple_databases/id.sql))
This macro generates an id field that can be used as a column for the current model.

Usage:
`{{ pm_utils.id() }}`

#### min_boolean ([source](macros/multiple_databases/min_boolean.sql))
This macro selects the minimum of the records in an aggregate expression for boolean fields.

Expand Down

0 comments on commit 6235515

Please sign in to comment.