# dbt Connector

This connector extracts technical metadata from a [dbt project](https://docs.getdbt.com/docs/building-a-dbt-project/projects) by parsing the `manifest.json` & `catalog.json` files generated by `dbt docs generate` command.

## Setup

There is no special setup needed to run the connector as a CLI. However, we recommend running it as part of your dbt project's CI/CD workflow so that the metadata is refreshed automatically with each commit. Please refer to [Metaphor dbt GitHub Action](https://github.com/MetaphorData/dbt-action) for more details.

## Config File

Create a YAML config file based the following template.

```yaml
manifest: <path_to_manifest_json>
catalog: <path_to_catalog_json>
account: <snowflake_account>
output:
  file:
    path: <path_to_output_file>
```

## Testing

Follow the [Installation](../../README.md) instructions to install `metaphor-connectors` in your environment (or virtualenv). Make sure to include either `all` or `dbt` extra.

To test the connector locally, change the config file to output to a local path and run the following command

```
python -m metaphor.dbt <config_file>
```

Manually verify the output after the run finishes.
