TiDB Profile
Vendor-supported plugin
Some core functionality may be limited. If you're interested in contributing, check out the source code repository listed below.
Overview of dbt-tidbβ
Maintained by: PingCAP
Author: Xiang Zhang and Qiang Wu
Source: https://github.com/pingcap/dbt-tidb
Core version: v1.0.0 and newer
dbt Cloud: Not Supported
The easiest way to install it is to use pip:
pip install dbt-tidb
Connecting to TiDB with dbt-tidbβ
User / Password Authenticationβ
Configure your dbt profile for using TiDB:
TiDB connection profileβ
profiles.yml
dbt-tidb:
target: dev
outputs:
dev:
type: tidb
server: 127.0.0.1
port: 4000
schema: database_name
username: tidb_username
password: tidb_password
Description of Profile Fieldsβ
Option | Description | Required? | Example |
---|---|---|---|
type | The specific adapter to use | Required | tidb |
server | The server (hostname) to connect to | Required | yourorg.tidb.com |
port | The port to use | Required | 4000 |
schema | Specify the schema (database) to build models into | Required | analytics |
username | The username to use to connect to the server | Required | dbt_admin |
password | The password to use for authenticating to the server | Required | awesome_password |
Database User Privilegesβ
Your database user would be able to have some abilities to read or write, such as SELECT
, CREATE
, and so on.
You can find some help here with TiDB privileges management.
Required Privilege |
---|
SELECT |
CREATE |
CREATE TEMPORARY TABLE |
CREATE VIEW |
INSERT |
DROP |
SHOW DATABASE |
SHOW VIEW |
SUPER |
Supported featuresβ
TiDB 4.X | TiDB 5.0 ~ 5.2 | TiDB >= 5.3 | Feature |
---|---|---|---|
β | β | β | Table materialization |
β | β | β | View materialization |
β | β | β | Incremental materialization |
β | β | β | Ephemeral materialization |
β | β | β | Seeds |
β | β | β | Sources |
β | β | β | Custom data tests |
β | β | β | Docs generate |
β | β | β | Snapshots |
Note:
- TiDB 4.0 ~ 5.0 does not support CTE,
you should avoid using
WITH
in your SQL code. - TiDB 4.0 ~ 5.2 does not support creating a temporary table or view.
- TiDB 4.X does not support using SQL func in
CREATE VIEW
, avoid it in your SQL code. You can find more detail here.