dbt-ydb


Namedbt-ydb JSON
Version 0.0.12 PyPI version JSON
download
home_pageNone
SummaryDBT adapter for YDB
upload_time2025-10-07 15:29:47
maintainerNone
docs_urlNone
authorYandex LLC
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <img src="https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg" alt="dbt logo" width="500"/>
</p>

# dbt-ydb

**dbt-ydb** is a plugin for [dbt](https://www.getdbt.com/) that provides support for working with [YDB](https://ydb.tech). **dbt-ydb** adapter is in preview stage and does not currently support all dbt features. The sections below list the supported features and known limitations.

## Installation

To install plugin, execute the following command:

```bash
pip install dbt-ydb
```

## Supported features

- [x] Table materialization
- [x] View materialization
- [x] Seeds
- [x] Docs generate
- [x] Tests
- [x] Incremental materializations (`merge` strategy only)
- [x] Snapshots

## Limitations

* `YDB` does not support CTE
* `YDB` requires a primary key to be specified for its tables. See the configuration section for instructions on how to set it.
* `source()` macro requires you to specify a `schema`. Use `/` if your source is in root folder.

## Usage

### Profile Configuration

To configure YDB connection, fill `profile.yml` file as below:

```
profile_name:
  target: dev
  outputs:
    dev:
      type: ydb
      host: [localhost] # YDB host
      port: [2136] # YDB port
      database: [/local] # YDB database
      schema: [<empty string>] # Optional subfolder for DBT models
      secure: [False] # If enabled, grpcs protocol will be used
      root_certificates_path: [<empty string>] # Optional path to root certificates file

      # Static Credentials
      username: [<empty string>]
      password: [<empty string>]

      # Access Token Credentials
      token: [<empty string>]

      # Service Account Credentials
      service_account_credentials_file: [<empty string>]
```

### Model Configuration

#### View

| Option | Description | Required | Default |
| ------ | ----------- | -------- | ------- |

#### Table

| Option | Description | Required | Default |
| ------ | ----------- | -------- | ------- |
| `primary_key` | Primary key expression to use during table creation | `yes` | |
| `store_type` | Type of table. Available options are `row` and `column` | `no` | `row` |
| `auto_partitioning_by_size` | Enable automatic partitioning by size. Available options are `ENABLED` and `DISABLED` | `no` | |
| `auto_partitioning_partition_size_mb` | Partition size in megabytes for automatic partitioning | `no` | |
| `ttl` | Time-to-live (TTL) expression for automatic data expiration | `no` | |

#### Incremental

| Option | Description | Required | Default |
| ------ | ----------- | -------- | ------- |
| `incremental_strategy` | Strategy of incremental materialization. Current adapter supports only `merge` strategy, which will use `YDB`'s `UPSERT` operation. | `no` | `default` |
| `primary_key` | Primary key expression to use during table creation | `yes` | |
| `store_type` | Type of table. Available options are `row` and `column` | `no` | `row` |
| `auto_partitioning_by_size` | Enable automatic partitioning by size. Available options are `ENABLED` and `DISABLED` | `no` | |
| `auto_partitioning_partition_size_mb` | Partition size in megabytes for automatic partitioning | `no` | |
| `ttl` | Time-to-live (TTL) expression for automatic data expiration | `no` | |

##### Example table configuration

```sql
{{ config(
    primary_key='id, created_at',
    store_type='row',
    auto_partitioning_by_size='ENABLED',
    auto_partitioning_partition_size_mb=256,
    ttl='Interval("P30D") on created_at'
) }}

select
    id,
    name,
    created_at
from {{ ref('source_table') }}
```

#### Seed

| Option | Description | Required | Default |
| ------ | ----------- | -------- | ------- |
| `primary_key` | Primary key expression to use during table creation | `no` | The first column of CSV will be used as default. |


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dbt-ydb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Yandex LLC",
    "author_email": "ydb@yandex-team.ru",
    "download_url": "https://files.pythonhosted.org/packages/2b/77/c5621031135d0bebdafeaa429d13fac8003aaf813843f94b8efde38184d6/dbt_ydb-0.0.12.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/dbt-labs/dbt/ec7dee39f793aa4f7dd3dae37282cc87664813e4/etc/dbt-logo-full.svg\" alt=\"dbt logo\" width=\"500\"/>\n</p>\n\n# dbt-ydb\n\n**dbt-ydb** is a plugin for [dbt](https://www.getdbt.com/) that provides support for working with [YDB](https://ydb.tech). **dbt-ydb** adapter is in preview stage and does not currently support all dbt features. The sections below list the supported features and known limitations.\n\n## Installation\n\nTo install plugin, execute the following command:\n\n```bash\npip install dbt-ydb\n```\n\n## Supported features\n\n- [x] Table materialization\n- [x] View materialization\n- [x] Seeds\n- [x] Docs generate\n- [x] Tests\n- [x] Incremental materializations (`merge` strategy only)\n- [x] Snapshots\n\n## Limitations\n\n* `YDB` does not support CTE\n* `YDB` requires a primary key to be specified for its tables. See the configuration section for instructions on how to set it.\n* `source()` macro requires you to specify a `schema`. Use `/` if your source is in root folder.\n\n## Usage\n\n### Profile Configuration\n\nTo configure YDB connection, fill `profile.yml` file as below:\n\n```\nprofile_name:\n  target: dev\n  outputs:\n    dev:\n      type: ydb\n      host: [localhost] # YDB host\n      port: [2136] # YDB port\n      database: [/local] # YDB database\n      schema: [<empty string>] # Optional subfolder for DBT models\n      secure: [False] # If enabled, grpcs protocol will be used\n      root_certificates_path: [<empty string>] # Optional path to root certificates file\n\n      # Static Credentials\n      username: [<empty string>]\n      password: [<empty string>]\n\n      # Access Token Credentials\n      token: [<empty string>]\n\n      # Service Account Credentials\n      service_account_credentials_file: [<empty string>]\n```\n\n### Model Configuration\n\n#### View\n\n| Option | Description | Required | Default |\n| ------ | ----------- | -------- | ------- |\n\n#### Table\n\n| Option | Description | Required | Default |\n| ------ | ----------- | -------- | ------- |\n| `primary_key` | Primary key expression to use during table creation | `yes` | |\n| `store_type` | Type of table. Available options are `row` and `column` | `no` | `row` |\n| `auto_partitioning_by_size` | Enable automatic partitioning by size. Available options are `ENABLED` and `DISABLED` | `no` | |\n| `auto_partitioning_partition_size_mb` | Partition size in megabytes for automatic partitioning | `no` | |\n| `ttl` | Time-to-live (TTL) expression for automatic data expiration | `no` | |\n\n#### Incremental\n\n| Option | Description | Required | Default |\n| ------ | ----------- | -------- | ------- |\n| `incremental_strategy` | Strategy of incremental materialization. Current adapter supports only `merge` strategy, which will use `YDB`'s `UPSERT` operation. | `no` | `default` |\n| `primary_key` | Primary key expression to use during table creation | `yes` | |\n| `store_type` | Type of table. Available options are `row` and `column` | `no` | `row` |\n| `auto_partitioning_by_size` | Enable automatic partitioning by size. Available options are `ENABLED` and `DISABLED` | `no` | |\n| `auto_partitioning_partition_size_mb` | Partition size in megabytes for automatic partitioning | `no` | |\n| `ttl` | Time-to-live (TTL) expression for automatic data expiration | `no` | |\n\n##### Example table configuration\n\n```sql\n{{ config(\n    primary_key='id, created_at',\n    store_type='row',\n    auto_partitioning_by_size='ENABLED',\n    auto_partitioning_partition_size_mb=256,\n    ttl='Interval(\"P30D\") on created_at'\n) }}\n\nselect\n    id,\n    name,\n    created_at\nfrom {{ ref('source_table') }}\n```\n\n#### Seed\n\n| Option | Description | Required | Default |\n| ------ | ----------- | -------- | ------- |\n| `primary_key` | Primary key expression to use during table creation | `no` | The first column of CSV will be used as default. |\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "DBT adapter for YDB",
    "version": "0.0.12",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dd28fa674d872f7898b267aa8a14cc26efc973689b82fc32be1182a55d0f97b0",
                "md5": "41b3783bde648c935713effc7799cdb2",
                "sha256": "b48f6741ce43a205be2e932b49175e33660f7999483b52be00f2301828f0b171"
            },
            "downloads": -1,
            "filename": "dbt_ydb-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "41b3783bde648c935713effc7799cdb2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 25712,
            "upload_time": "2025-10-07T15:29:46",
            "upload_time_iso_8601": "2025-10-07T15:29:46.285630Z",
            "url": "https://files.pythonhosted.org/packages/dd/28/fa674d872f7898b267aa8a14cc26efc973689b82fc32be1182a55d0f97b0/dbt_ydb-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2b77c5621031135d0bebdafeaa429d13fac8003aaf813843f94b8efde38184d6",
                "md5": "975bbbd4d9274c3a42f276f07c6f0914",
                "sha256": "bc71c7cdeec277899cd511f5c9da3975752e169bcbab6a0de6a3812f25b40793"
            },
            "downloads": -1,
            "filename": "dbt_ydb-0.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "975bbbd4d9274c3a42f276f07c6f0914",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 18669,
            "upload_time": "2025-10-07T15:29:47",
            "upload_time_iso_8601": "2025-10-07T15:29:47.374509Z",
            "url": "https://files.pythonhosted.org/packages/2b/77/c5621031135d0bebdafeaa429d13fac8003aaf813843f94b8efde38184d6/dbt_ydb-0.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-07 15:29:47",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dbt-ydb"
}
        
Elapsed time: 1.24142s