dbt-exasol adapter
dbt-exasol is an adapter that enables dbt (data build tool) to connect and interact with an Exasol data warehouse. It provides the necessary plumbing for dbt to compile and run SQL models against Exasol, supporting its specific SQL dialect and features. Currently at v1.10.5, the library is actively maintained with frequent releases to ensure compatibility with new dbt-core versions and address Exasol-specific behaviors.
Warnings
- breaking dbt-exasol has strict compatibility requirements with dbt-core and Python versions. Upgrading dbt-exasol or dbt-core independently can lead to breakage. For dbt-exasol >=1.10.0 (including 1.10.5), ensure you use dbt-core >=1.9.0, <1.11.0 and Python ^3.10, <3.14.
- gotcha Older versions of dbt-exasol might have issues with connection leaks and cache inconsistencies, particularly in multi-threaded or long-running dbt processes, potentially leading to resource exhaustion or stale data in some scenarios.
- gotcha Prior to v1.10.3, SQL keyword column names in seed operations might not have been automatically quoted, leading to syntax errors when loading data if column names conflicted with Exasol reserved keywords.
- gotcha The snapshot implementation was modernized in v1.10.0 to support dbt-core 1.9+ features. Using dbt-core 1.9 or higher with older dbt-exasol versions might result in unexpected behavior or errors with snapshot models.
Install
-
pip install dbt-exasol
Imports
- dbt_exasol
from dbt_exasol import whatever_if_needed
Quickstart
import os
# This quickstart demonstrates the configuration for dbt-exasol.
# dbt-exasol is used via the dbt CLI, not direct Python execution of models.
# 1. Install dbt-exasol: pip install dbt-exasol
# 2. Configure your Exasol connection in ~/.dbt/profiles.yml (or project-specific):
profiles_yml_example = f'''
exasol_profile:
target: dev
outputs:
dev:
type: exasol
host: {{os.environ.get('EXASOL_HOST', 'your_exasol_host')}}
port: {{os.environ.get('EXASOL_PORT', 8563)}}
schema: {{os.environ.get('EXASOL_SCHEMA', 'your_schema')}}
user: {{os.environ.get('EXASOL_USER', 'your_user')}}
password: {{os.environ.get('EXASOL_PASSWORD', 'your_password')}}
# Optional advanced properties (e.g., for JDBC)
# jdbc_properties:
# connectionTimeout: 10000
'''
print("Example profiles.yml content (use environment variables for security):")
print(profiles_yml_example)
# 3. Create a dbt project and specify the profile (dbt_project.yml):
# name: 'my_exasol_project'
# version: '1.0.0'
# config-version: 2
# profile: 'exasol_profile'
# 4. Create a simple dbt model (e.g., models/my_first_model.sql):
sql_model_example = '''
-- models/my_first_model.sql
SELECT
'Hello, dbt-Exasol!' as greeting,
CURRENT_TIMESTAMP as current_time
FROM DUAL;
'''
print("\nExample dbt model content:")
print(sql_model_example)
# 5. Run dbt commands from your project directory:
# dbt debug --target dev
# dbt run
if __name__ == '__main__':
print("\nThis code provides configuration examples. Actual execution is via the dbt CLI.")
print("Please set environment variables like EXASOL_HOST, EXASOL_USER, EXASOL_PASSWORD before running dbt commands.")