Metadata-Version: 2.1
Name: dbt-databend
Version: 1.1.0
Summary: The Databend plugin for dbt (data build tool)
Home-page: https://github.com/silentsokolov/dbt-databend
Author: Dmitriy Sokolov
Author-email: silentsokolov@gmail.com
License: MIT
Keywords: dbt,databend
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

<p align="center">
  <img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="300"/>
</p>

[![build](https://github.com/silentsokolov/dbt-databend/actions/workflows/build.yml/badge.svg)](https://github.com/silentsokolov/dbt-databend/actions/workflows/build.yml)

## dbt-databend

The `dbt-databend` package contains all of the code enabling [dbt](https://getdbt.com) to work with [Databend](https://databend.rs/).

## Getting started

- [Install dbt](https://docs.getdbt.com/docs/installation)
- Read the [introduction](https://docs.getdbt.com/docs/introduction/) and [viewpoint](https://docs.getdbt.com/docs/about/viewpoint/)

### Installation

Use your favorite Python package manager to install the app from PyPI, e.g.

```bash
python -m pip install dbt-databend
```

### Supported features

Databend does not support a `ALTER` query for change a tables schema. So some features are not available.

- [x] Table materialization
- [x] View materialization
- [ ] Incremental materialization
- [x] Seeds
- [x] Sources
- [x] Docs generate
- [ ] Tests
- [ ] Snapshots
- [ ] Ephemeral materialization

### Database & schema

The dbt model `database.schema.table` is not compatible with Databend because Databend does not support a `schema`.
So we use a simple model `schema.table`, where `schema` is the Databend's database.

### Configuration

| Option     | Description                                                                                                                                            | Required?              |
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
| cluster_by | For detailed information about the CLUSTER BY clause, see [SET CLUSTER KEY](https://databend.rs/doc/reference/sql/ddl/clusterkey/dml-set-cluster-key). | Optional (default: `empty`) |

### Profile Configuration

Databend targets should be set up using the following configuration in your `profiles.yml` file.
The `dbt-databend` package usage mysql-procotol for connect to database.

```yaml
your_profile_name:
  target: dev
  outputs:
    dev:
      type: databend
      host: [hostname]
      port: [port]  # default 3307
      user: [username]
      password: [password]
      schema: [database name]
```
