Skip to main content

dbt logo

dbt-timeplus

This plugin ports dbt functionality to Timeplus Proton.

Installation

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

pip install dbt-timeplus

Development

Follow the dbt Documentation to install dbt with pip.

python3.10 -m venv proton-dbt-env
source proton-dbt-env/bin/activate
# Installs matching versions for local dev/tests
pip install -r dev_requirements.txt

Then run pip install -e . to install the current dev code.

Testing:

  • pytest tests/unit runs fast unit tests (no DB needed).
  • Functional tests require a running Timeplus endpoint. Export env vars or use tests/test.env:
    • DBT_TEST_HOST (default localhost)
    • DBT_TEST_PORT (default 8463)
    • DBT_TEST_USER (default default)
    • DBT_TEST_PASSWORD (default empty)
    • DBT_TEST_SCHEMA (default default)
  • Run pytest tests/functional for functional tests.
  • Run pytest tests/integration/timeplus.dbtspec for integration tests.

External sinks (Kafka / ClickHouse)

  • If you run Kafka/ClickHouse locally (e.g., via Docker Compose), set the relevant environment variables for your setup, then run pytest -k external to execute only those tests. See tests/test.env.sample for the full variable list.

Note: host:port values depend on your environment and are not enforced by the adapter. Use the ports your services expose.

Typical defaults:

  • ClickHouse native: 9000 (plain), 9440 (TLS). HTTP: 8123/8443.
  • Kafka brokers: 9092 (plain), others depending on your deployment.

Tip: copy tests/test.env.sample to tests/test.env and edit for local runs (pytest-dotenv loads it automatically).

Compatibility

  • Python: 3.10, 3.11, 3.12
  • dbt-core: 1.10.x (pinned to 1.10.13)
  • proton-driver: >=0.2.13

Supported features

  • Table materialization
  • View materialization
  • Incremental materialization
  • Seeds
  • Sources
  • Docs generate
  • Tests
  • Snapshots (experimental)
  • Ephemeral materialization

Usage Notes

Database

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

Bounded vs streaming queries

Timeplus streams are streaming by default. To avoid long-running queries in dbt models and tests, wrap streaming sources with table(...) when selecting, for example:

select window_end, cid, count() as cnt
from tumble(table(car_live_data), 1s)
group by window_end, cid

This produces a bounded snapshot for deterministic builds.

Model Configuration

Option Description Default
engine Stream engine used when creating streams Stream(1, 1, rand())
order_by Column(s) or expression(s) used for ordering to_start_of_hour(_tp_time)
partition_by Partition expression for stream to_YYYYMMDD(_tp_time)

Example Profile

your_profile_name:
  target: dev
  outputs:
    dev:
      type: timeplus
      schema: [database name] # default default
      host: [db.url.timeplus] # default localhost

      # optional
      port: [port]  # default 8463
      user: [user]
      password: [abc123]
      verify: [verify] # default False
      secure: [secure] # default False
      connect_timeout: [10] # default 10
      send_receive_timeout: [300] # default 300
      sync_request_timeout: [5] # default 5
      compress_block_size: [1048576] # default 1048576
      compression: ['lz4'] # default '' (disable)

Materialized views

Create a materialized view that writes into a target stream and optionally applies settings:

{{ config(materialized='materialized_view', into='mv_target', settings='checkpoint_interval=5') }}
select window_start as win_start, s, sum(i) as total
from tumble(table(rd), 2s)
group by window_start, s

External sinks (Kafka / ClickHouse)

The adapter includes tests/examples for Kafka and ClickHouse sinks. Export the environment variables shown above and run pytest -k external to execute only those tests.

Release and versioning

  • Package name: dbt-timeplus (renamed from dbt-proton).
  • Adapter version mirrors dbt minor (1.10.*).
  • The bundled macro package version in dbt/include/timeplus/dbt_project.yml is kept in sync as a convention.

Metadata

Release files for dbt-timeplus 1.10.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-timeplus 1.10.2
File Size Uploaded Provenance Actions
dbt_timeplus-1.10.2.tar.gz 24.8 kB With provenance Details for dbt_timeplus-1.10.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbt-timeplus 1.10.2
File Interpreter ABI Platform Actions
dbt_timeplus-1.10.2-py3-none-any.whl Python 3 none any Details for dbt_timeplus-1.10.2-py3-none-any.whl

Total release size: 53.4 kB

Release files / dbt_timeplus-1.10.2.tar.gz

Download URL dbt_timeplus-1.10.2.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
28dae34509b25413abf4ee820b92f807221f8e29c8ac034507bb6cd3f609a336
BLAKE2b-256 checksum
How to use checksums
475c9ee38d354964fdb6eded38ded5588a244f42c7e6a2ef58f2ae1491ad7b27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2025.

Transparency log

Release files / dbt_timeplus-1.10.2-py3-none-any.whl

Download URL dbt_timeplus-1.10.2-py3-none-any.whl
Size 28.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95192dd3bf95ce43bf0913cb306c16cb9e06e56d10c10e59490b21609f676e27
BLAKE2b-256 checksum
How to use checksums
ca7d03bd8c38dbdefa581b670e6219a704d31c98c379fd34c48b28486d7cba61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2025.

Transparency log

Security for dbt-timeplus 1.10.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dbt_timeplus-1.10.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.10.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page