dbt
dbt (data build tool) enables data teams to transform data using analytics engineering best practices. Use the Altertable adapter to run your dbt models directly in your Altertable lakehouse.
Installation
The Altertable adapter for dbt is available on PyPI and works with dbt-core.
pip install dbt-altertable
Configuration
Add an Altertable profile to your profiles.yml file. By default, dbt looks for profiles in ~/.dbt/profiles.yml, but you can also place it in your project directory or specify a custom location using the --profiles-dir flag. Learn more about dbt profiles in the dbt documentation.
Profile Example
your_project_name:target: devoutputs:dev:type: altertableusername: your_altertable_usernamepassword: your_altertable_passworddatabase: your_catalog_nameschema: your_schema_name
Configuration Parameters
- type: Must be set to
altertable(required) - username: Your Altertable username (required) — find this in the Credentials section of the dashboard
- password: Your Altertable password (required) — find this in the Credentials section of the dashboard
- database: The name of your Altertable connection's catalog where models will be materialized (required)
- schema: The schema within your catalog where models will be created (required)
Usage
Once configured, you can use dbt with Altertable just like any other adapter:
# Test your connectiondbt debug# Run your modelsdbt run# Test your modelsdbt test# Generate and serve documentationdbt docs generatedbt docs serve
Learn more about dbt commands in the dbt documentation.
SQL Dialect
Altertable uses DuckDB as its query engine, so all SQL queries in your dbt models must use DuckDB-flavored SQL. This includes using DuckDB's functions, syntax, and data types.
Learn more about DuckDB SQL in the DuckDB documentation.
Source Code
The adapter source code is available at github.com/altertable-ai/dbt-altertable