{"id":18684800,"url":"https://github.com/j-sephb-lt-n/dbt-example","last_synced_at":"2026-05-18T09:31:20.370Z","repository":{"id":246964917,"uuid":"824740542","full_name":"J-sephB-lt-n/dbt-example","owner":"J-sephB-lt-n","description":"Showcase of DBT functionality with a toy local duckdb dataset","archived":false,"fork":false,"pushed_at":"2024-08-01T19:26:40.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-10T07:40:59.959Z","etag":null,"topics":["dbt","duckdb","example","local","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/J-sephB-lt-n.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-07-05T20:36:09.000Z","updated_at":"2024-10-12T12:02:35.000Z","dependencies_parsed_at":"2024-08-01T21:15:07.659Z","dependency_job_id":null,"html_url":"https://github.com/J-sephB-lt-n/dbt-example","commit_stats":null,"previous_names":["j-sephb-lt-n/dbt-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/J-sephB-lt-n/dbt-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fdbt-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fdbt-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fdbt-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fdbt-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J-sephB-lt-n","download_url":"https://codeload.github.com/J-sephB-lt-n/dbt-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J-sephB-lt-n%2Fdbt-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33172576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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","duckdb","example","local","tutorial"],"created_at":"2024-11-07T10:19:23.813Z","updated_at":"2026-05-18T09:31:20.355Z","avatar_url":"https://github.com/J-sephB-lt-n.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dbt-example\n\nShowcase of dbt functionality with a toy dataset - I use this repo to remind myself of the features of DBT and how they work.\n\nI am using a local DuckDB database.\n\nWhy use DBT? Because it encourages and facilitates data warehouse and software best practices through it's design:\n\n- Data lineage (e.g. logging, snapshots)\n\n- Documentation\n\n- Testing\n\n- Modularisation\n\n- Separation of environments (e.g. dev, staging, prod)\n\n- DRY\n\n- Version control\n\nThe DBT best practice guide is amazing: \u003chttps://docs.getdbt.com/best-practices\u003e\n\nAfter running each step, you can see the changes made within the database itself using (e.g. run this in the duckdb cli):\n\n```sql\nselect table_catalog, table_schema, table_name, table_type from information_schema.tables;\n```\n\n```bash\npython -m venv venv\nsource venv/bin/activate\npip install --no-deps -r requirements.txt\ndbt --version\ndbt debug # check that everything set up correctly\n\npython -m simdata.init_db --db_name 'dev' # creates data in database databases/dev.duckdb\ndbt source freshness # check freshness of input data\ndbt run # run dbt models\ndbt test # run all tests\n\ndbt snapshot # create snapshot tables\npython -m simdata.update_payment_status_example --db_name 'dev' # adds a row to the bank table so can see pay_status_snapshot table working\ndbt run # refresh pipeline to take into account new row in bank table\ndbt snapshot\n\ndbt docs generate\ndbt docs serve\n\n# tidy up\ndbt clean # clean up dbt project\nrm databases/* # remove databases\n```\n\nalthough it is outside the repo, my ~/.dbt/profiles.yml looks like this:\n\n```yaml\ndbt_example:\n  target: dev\n  outputs:\n    dev:\n      type: duckdb\n      path: \"databases/dev.duckdb\"\n      schema: main # default target schema\n      threads: 4\n```\n\nhere are links to specific things in this project:\n\n- [A custom generic data test](./tests/generic/test_is_valid_id.sql) (you can see it applied [here](./models/staging/data_tests.yml))\n  - You can run `python -m simdata.add_non_valid_order_id --db_name dev` to add a non-valid ID into the source data if you want to see the test fail (you will need to run `dbt run` before `dbt test` in order to see the test fail)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-sephb-lt-n%2Fdbt-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj-sephb-lt-n%2Fdbt-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj-sephb-lt-n%2Fdbt-example/lists"}