Skip to content

Commit

Permalink
docs: update README for create_index macro
Browse files Browse the repository at this point in the history
  • Loading branch information
silviustanimir authored and cverhoef committed Aug 10, 2022
1 parent c4fba9f commit 0a6d638
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ packages:
revision: [tag name of the release]
```

This package contains some date/time conversion macros. You can override the default format that is used in the macros by defining variables in your `dbt_project.yml`. The following shows an example configuration of all the possible variables and the default values used:
This package contains some date/time conversion macros. You can override the default format that is used in the macros by defining variables in your `dbt_project.yml`. The following shows an example configuration of the possible date and time formatting variables and their default values:

```
vars:
Expand All @@ -26,6 +26,7 @@ This dbt package contains macros for SQL functions to run the dbt project on mul

- [Multiple databases](#Multiple-databases)
- [as_varchar](#as_varchar-source)
- [create_index](#create_index-source)
- [date_from_timestamp](#date_from_timestamp-source)
- [datediff](#datediff-source)
- [generate_id](#generate_id-source)
Expand Down Expand Up @@ -69,6 +70,19 @@ This macro converts a string to the data type `nvarchar(2000)` for SQL Server. U
Usage:
`{{ pm_utils.as_varchar('[expression]') }}`

#### create_index ([source](macros/multiple_databases/create_index.sql))
This macro creates a clustered columnstore index on the source table given as argument for SQL Server.

Usage:
```
{{ config(
pre_hook="pm_utils.create_index('[input_table]') }}"
) }}
```

Variables:
- schema_sources

#### date_from_timestamp ([source](macros/multiple_databases/date_from_timestamp.sql))
This macro extracts the date part from a datetime field.

Expand Down

0 comments on commit 0a6d638

Please sign in to comment.