Skip to content

Commit

Permalink
Documenting custom materializations (#5211)
Browse files Browse the repository at this point in the history
[Preview](https://docs-getdbt-com-git-dbeatty10-patch-1-dbt-labs.vercel.app/faqs/Docs/documenting-macros#document-a-custom-materialization)

## What are you changing in this pull request and why?

dbt-labs/dbt-core#9841 asked about documenting
custom materializations, and this PR explains how to document the
macro(s) associated with each custom materialization.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] I tested that the code example works
  • Loading branch information
mirnawong1 authored Apr 4, 2024
2 parents 26ce6e2 + bb2f218 commit 5f37685
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions website/docs/faqs/Docs/documenting-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,26 @@ macros:
```
</File>
## Document a custom materialization
When you create a [custom materialization](/guides/create-new-materializations), dbt creates an associated macro with the following format:
```
materialization_{materialization_name}_{adapter}
```

To document a custom materialization, use the previously mentioned format to determine the associated macro name(s) to document.

<File name='macros/properties.yml'>

```yaml
version: 2

macros:
- name: materialization_my_materialization_name_default
description: A custom materialization to insert records into an append-only table and track when they were added.
- name: materialization_my_materialization_name_xyz
description: A custom materialization to insert records into an append-only table and track when they were added.
```
</File>

0 comments on commit 5f37685

Please sign in to comment.