dbt SQLite Adapter

raw JSON →
1.10.0 verified Fri May 01 auth: no python

A SQLite adapter plugin for dbt (data build tool). Allows using SQLite as a target database for dbt transformations. Version 1.10.0 is compatible with dbt-core >= 1.10.x. The adapter is maintained by the community, with releases tracking dbt-core minor versions.

pip install dbt-sqlite
error dbt.exceptions.PluginNotInstalled: Cannot load adapter: sqlite, plugin 'sqlite' not found. The following packages are installed: ['dbt-core', 'dbt-sqlite']
cause dbt-sqlite is not registered correctly, or the version mismatches dbt-core.
fix
Install a compatible version: pip install 'dbt-sqlite==1.10.0' and ensure dbt-core==1.10.x.
error sqlite3.OperationalError: no such module: ...
cause Missing SQLite extensions (e.g., crypto, math) needed for dbt macros.
fix
Install sqlean and configure the extension path in your profiles.yml under the 'extensions' option.
error OperationalError: database is locked
cause Multiple threads trying to write to the SQLite file simultaneously.
fix
Set threads: 1 in profiles.yml, or use a different database for concurrent access.
breaking dbt-sqlite releases are tied to specific dbt-core minor versions. Using v1.10.0 with dbt-core 1.9.x will cause import errors.
fix Ensure dbt-core and dbt-sqlite versions match (e.g., dbt-core 1.10.x with dbt-sqlite 1.10.x).
gotcha SQLite does not support concurrent writes; threads > 1 may cause database locked errors.
fix Set threads: 1 in your profiles.yml for SQLite profiles.
deprecated The 'digest.so' extension path in old sample profiles.yml has been removed. Use 'sqlean' modules instead.
fix Update your profiles.yml to reference sqlean modules (e.g., paths to sqlean extensions) as shown in the v1.9.1 release notes.
gotcha SQLite has limited support for cross-database macros (e.g., dateadd, datediff). Some functions may not work without the sqlean extension.
fix Install sqlean.py (pip install sqlean.py) and load the necessary extensions in your SQLite connection.

After installing dbt-sqlite, set up a profile pointing to a SQLite database file, then run dbt.

# Create a profiles.yml file
# ~/.dbt/profiles.yml:
# dbt_sqlite:
#   outputs:
#     dev:
#       type: sqlite
#       threads: 1
#       database: 'database'
#       schema: 'main'
#       path: /path/to/your_sqlite.db
#   target: dev

dbt init my_project
cd my_project
dbt run