{"id":43121622,"url":"https://github.com/codeforkjeff/dbt-sqlite","last_synced_at":"2026-01-31T19:37:25.442Z","repository":{"id":39602238,"uuid":"310378263","full_name":"codeforkjeff/dbt-sqlite","owner":"codeforkjeff","description":"A SQLite adapter plugin for dbt (data build tool)","archived":false,"fork":false,"pushed_at":"2025-06-28T00:26:18.000Z","size":185,"stargazers_count":83,"open_issues_count":16,"forks_count":17,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-08T17:37:43.899Z","etag":null,"topics":["dbt","elt","etl","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeforkjeff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-05T17:58:22.000Z","updated_at":"2025-10-05T14:50:06.000Z","dependencies_parsed_at":"2024-06-18T22:51:29.963Z","dependency_job_id":"234c5f42-2dc7-4066-9ca9-492cfc3d0d24","html_url":"https://github.com/codeforkjeff/dbt-sqlite","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/codeforkjeff/dbt-sqlite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforkjeff%2Fdbt-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforkjeff%2Fdbt-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforkjeff%2Fdbt-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforkjeff%2Fdbt-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeforkjeff","download_url":"https://codeload.github.com/codeforkjeff/dbt-sqlite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforkjeff%2Fdbt-sqlite/sbom","scorecard":{"id":296372,"data":{"date":"2025-08-11","repo":{"name":"github.com/codeforkjeff/dbt-sqlite","commit":"ca576b4733829ab65c136c395ce7ac70aaf43cba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Code-Review","score":1,"reason":"Found 3/17 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":5,"reason":"5 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/codeforkjeff/dbt-sqlite/ci.yml/main?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:4","Warn: pipCommand not pinned by hash: Dockerfile:10","Warn: pipCommand not pinned by hash: Dockerfile:21","Warn: pipCommand not pinned by hash: Dockerfile:23","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T19:36:31.281Z","repository_id":39602238,"created_at":"2025-08-17T19:36:31.281Z","updated_at":"2025-08-17T19:36:31.281Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28951708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbt","elt","etl","sqlite"],"created_at":"2026-01-31T19:37:24.785Z","updated_at":"2026-01-31T19:37:25.437Z","avatar_url":"https://github.com/codeforkjeff.png","language":"Python","readme":"\n# dbt-sqlite\n\nA [SQLite](https://sqlite.org) adapter plugin for [dbt](https://www.getdbt.com/) (data build tool)\n\nPlease read these docs carefully and use at your own risk. Issues and PRs welcome!\n\n## The Use Case\n\nSQLite is an embedded SQL database. It comes included with most Python\ndistributions and requires no installation or configuration. It can be\na good choice if your project meets any of these criteria:\n\n- you store the database file on fast, local storage\n(not on a network drive)\n- the amount of data is relatively small (GBs, not TBs)\n- you're a data team of one with no need to share access to a database\n- your end goal is to export the results of your pipeline(s) into other\nsystems for multi-user access or into BI/viz tools for analysis (i.e.\nyou're doing ETL vs ELT)\n- your project is a proof of concept, to eventually be moved into\nanother database or data warehouse platform\n- you want others to be able to deploy your data build without the\noverhead/cost of a full RDBMS or signing up for a data warehouse platform\n\nSQLite can be surprisingly fast, despite the query optimizer not being as\nsophisticated as other databases and data warehouse platforms. Tip: materialize\nyour models as tables and create indexes in post-hooks to speed up filtering\nand joins.\n\n## How to Use This\n\nUse the right version. Starting with the release of dbt-core 1.0.0,\nversions of dbt-sqlite are aligned to the same major+minor\n[version](https://semver.org/) of dbt-core.\n\n- versions 1.10.x of this adapter work with dbt-core 1.10.x\n- versions 1.9.x of this adapter work with dbt-core 1.9.x\n- versions 1.6.x - 1.8.x are not supported: this adapter fell behind, and\n  it's too much work to go back to support these versions\n- versions 1.5.x of this adapter work with dbt-core 1.5.x\n- versions 1.4.x of this adapter work with dbt-core 1.4.x\n- versions 1.3.x of this adapter work with dbt-core 1.3.x\n- versions 1.2.x of this adapter work with dbt-core 1.2.x\n- versions 1.1.x of this adapter work with dbt-core 1.1.x\n- versions 1.0.x of this adapter work with dbt-core 1.0.x\n- versions 0.2.x of this adapter work with dbt 0.20.x and 0.21.x\n- versions 0.1.x of this adapter work with dbt 0.19.x\n- versions 0.0.x of this adapter work with dbt 0.18.x\n\nInstall this package:\n\n```\n# run this to install the latest version\npip install dbt-sqlite\n\n# OR run this to install a specific version\npip install dbt-sqlite==1.0.0\n```\n\nCreate an entry in your `~/.dbt/profiles.yml` file with the following configuration:\n\n```YAML\ndbt_sqlite:\n\n  target: dev\n  outputs:\n    dev:\n      type: sqlite\n\n      # sqlite locks the whole db on writes so anything \u003e 1 won't help\n      threads: 1\n\n      # value is arbitrary\n      database: \"database\"\n\n      # value of 'schema' must be defined in schema_paths below. in most cases,\n      # this should be 'main'\n      schema: 'main'\n\n      # connect schemas to paths: at least one of these must be 'main'\n      schemas_and_paths:\n        main: '/my_project/data/etl.db'\n        dataset: '/my_project/data/dataset_v1.db'\n\n      # directory where all *.db files are attached as schema, using base filename\n      # as schema name, and where new schema are created. this can overlap with the dirs of\n      # files in schemas_and_paths as long as there's no conflicts.\n      schema_directory: '/my_project/data'\n\n      # optional: list of file paths of SQLite extensions to load. see README for more details.\n      extensions:\n        - \"/path/to/sqlean/crypto.so\"\n        - \"/path/to/sqlean/math.so\"\n        - \"/path/to/sqlean/text.so\"\n\n```\n\nSet `profile: 'dbt_sqlite'` in your project's `dbt_project.yml` file.\n\n## Notes\n\n- There is no 'database' portion of relation names in SQLite so it gets\nstripped from the output of `ref()` and from SQL everywhere. It still\nneeds to be set in the configuration and is used by dbt internally.\n\n- Schema are implemented as attached database files. (SQLite conflates databases\nand schemas.)\n\n  - SQLite automatically assigns 'main' to the file you initially connect to,\n  so this must be defined in your profile. Other schemas defined in your profile\n  get attached when database connection is created.\n\n  - If dbt needs to create a new schema, it will be created in `schema_directory`\n  as `schema_name.db`. Dropping a schema results in dropping all its relations,\n  detaching the database file from the session, and deleting the file.\n\n  - Schema names are stored in view definitions, so when you access a non-'main'\n  database file outside dbt, you'll need to attach it using the same name, or\n  the views won't work.\n\n  - SQLite does not allow views in one schema (i.e. database file) to reference\n  objects in another schema. You'll get this error from SQLite: \"view [someview]\n  cannot reference objects in database [somedatabase]\". You must set\n  `materialized='table'` in models that reference other schemas.\n\n- Materializations are simplified: they drop and re-create the model, instead of\ndoing the backup-and-swap-in new model that the other dbt database adapters\nsupport. This choice was made because SQLite doesn't support `DROP ... CASCADE`\nor `ALTER VIEW` or provide information about relation dependencies in something\ninformation_schema-like. These limitations make it really difficult to make the\nbackup-and-swap-in functionality work properly. Given how SQLite aggressively\n[locks](https://sqlite.org/lockingv3.html) the database anyway, it's probably\nnot worth the effort.\n\n- It's often idiomatic with dbt to use plentiful CASTs. The results of CASTs in\n  SQLite are tricky and depend on how the model is materialized. In a nutshell,\n  using table materializations gives better results.\n\n  - When materialized as a view, the resulting column type from any CAST (or\n    any expression) will always be empty. The SQLite adapter will regard this\n    column type as 'UNKNOWN'.\n\n  - When materialized as a table, a CAST will result in the specified type for\n    INT, REAL, TEXT; casts to NUMERIC and BOOLEAN result in a 'NUM' column type.\n\n- To get the best fidelity to your seed data, declare all the column types as TEXT\n  in your [seed configurations](https://docs.getdbt.com/reference/seed-configs)\n  and create a model to do the casts and conversions.\n\n\n## SQLite Extensions\n\nThese modules from SQLean are needed for certain functionality to work:\n- `crypto`: provides `md5` function needed for snapshots\n- `math`: provides `ceil` and `floor` needed for the datediff macro to work\n- `text`: provides `split_part` function\n\nPrecompiled binaries are available for download from the [SQLean github repository page](https://github.com/nalgeon/sqlean).\nYou can also compile them yourself if you want. Note that some modules depend on other libraries \n(`math` for example depends on GLIBC); if an extension fails to load, you may want to try building it yourself.\n\nPoint to these module files in your profile config as shown in the example above.\n\nMac OS seems to ship with [SQLite libraries that do not have support for loading extensions compiled in](https://docs.python.org/3/library/sqlite3.html#f1),\nso this won't work \"out of the box.\" Accordingly, snapshots won't work.\nIf you need snapshot functionality, you'll need to compile SQLite/python\nor find a python distribution for Mac OS with this support.\n\n## Development Notes / TODOs\n\n...\n\n### Publishing a release to PyPI\n\nBecause I forget...\n\n```\n# update version\nvi dbt/adapters/sqlite/__version__.py\n# update dbt-core dependency if appropriate\nvi setup.py\n\n# start clean\nrm -rf dist/ build/ *.egg-info\n\n# build\nuv build\n\n# upload to PyPI\nuv publish\n\ngit commit\ngit tag vXXX\ngit push --tags\n\n# go to github and \"Draft a new release\"\n```\n\n## Running Tests\n\nThis runs the test suite and cleans up after itself:\n```\n./run_tests_docker.sh\n```\n\nTo run tests interactively and be able to examine test artifacts:\n```\ndocker build . -t dbt-sqlite\n\ndocker run --rm -it dbt-sqlite bash\n\n# see output for the locations of artifacts\nrun_tests.sh -s\n```\n\n\n## Credits\n\nInspired by this initial work by stephen1000: https://github.com/stephen1000/dbt_sqlite\n\nhttps://github.com/jwills/dbt-duckdb/ - useful for ideas on working with\nanother embedded database\n\nhttps://github.com/fishtown-analytics/dbt-spark/ - spark also has two-part\nrelation names (no 'database')\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforkjeff%2Fdbt-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeforkjeff%2Fdbt-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforkjeff%2Fdbt-sqlite/lists"}