{"id":23885977,"url":"https://github.com/dpguthrie/snowflake-dbt-demo-new","last_synced_at":"2025-04-10T01:23:44.218Z","repository":{"id":182842776,"uuid":"669192705","full_name":"dpguthrie/snowflake-dbt-demo-new","owner":"dpguthrie","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-09T22:14:44.000Z","size":3382,"stargazers_count":0,"open_issues_count":10,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:23:17.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dpguthrie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-07-21T15:11:28.000Z","updated_at":"2025-04-07T17:01:15.000Z","dependencies_parsed_at":"2023-07-21T19:41:42.044Z","dependency_job_id":"29590a28-e388-428c-9d7e-5a7515157112","html_url":"https://github.com/dpguthrie/snowflake-dbt-demo-new","commit_stats":null,"previous_names":["dpguthrie/snowflake-dbt-demo-new"],"tags_count":0,"template":false,"template_full_name":"dpguthrie/snowflake-dbt-demo-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpguthrie%2Fsnowflake-dbt-demo-new","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpguthrie%2Fsnowflake-dbt-demo-new/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpguthrie%2Fsnowflake-dbt-demo-new/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpguthrie%2Fsnowflake-dbt-demo-new/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpguthrie","download_url":"https://codeload.github.com/dpguthrie/snowflake-dbt-demo-new/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138707,"owners_count":21053930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-01-04T05:56:14.134Z","updated_at":"2025-04-10T01:23:44.185Z","avatar_url":"https://github.com/dpguthrie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Welcome to the dbt Labs demo dbt project! We use the [TPCH dataset](https://docs.snowflake.com/en/user-guide/sample-data-tpch.html) to create a sample project to emulate what a production project might look like!\n\n                        _              __                   \n       ____ ___  ____ _(_)___     ____/ /__  ____ ___  ____ \n      / __ `__ \\/ __ `/ / __ \\   / __  / _ \\/ __ `__ \\/ __ \\\n     / / / / / / /_/ / / / / /  / /_/ /  __/ / / / / / /_/ /\n    /_/ /_/ /_/\\__,_/_/_/ /_/   \\__,_/\\___/_/ /_/ /_/\\____/ \n\n## Special demos\n\n- **dbt-external-tables:** Manage database objects that read data external to the warehouse within dbt. See `models/demo_examples/external_sources.yml`.\n- **Lifecycle Notifications:** See examples of dbt Cloud Job Lifecycle Notifications [here](https://gist.github.com/boxysean/3166b3ac55801685b6d275e9a9ddd5ee).\n- **Pivot tables:** One example of creating a pivot table using Snowflake syntax, another example using Jinja. See `models/aggregates/agg_yearly_*.sql`.\n\n## dbt Cloud Attached CLI\n\nThe files in `.devcontainer` allow a user to spin up a container with the dbt Cloud CLI installed.  The `.devcontainer.json` is currently minimally configured as a python container - feel free to modify or [add features](https://containers.dev/features) to fit your use case.  You can do this either [locally](https://code.visualstudio.com/docs/devcontainers/tutorial) or using Github's [Codespaces](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers)\n\n### Requirements\n\nYou'll need to set an environment variable, `DBT_CLOUD_API_KEY`.  You can set this locally or when using within codespaces, you'll need to add a secret in Github - [instructions here](https://docs.github.com/en/codespaces/managing-your-codespaces/managing-secrets-for-your-codespaces). \n\n## Codegen Examples\n\nThe codegen package can be run via the IDE, by clicking the \"Compile\" button, or in the command line.\n\n### Command Line\n\nThe example below shows how we can generate yml for a particular source:\n\n```bash\ndbt run-operation generate_source --args '{\"schema_name\": \"tpch_sf001\", \"database_name\": \"raw\", \"generate_columns\": \"true\", \"include_descriptions\": \"true\"}'\n```\n\n### IDE\n\nPaste in the snippets below in your IDE and click \"Compile\".\n\n### codegen.generate_source\n\nGenerates lightweight YAML for a Source\n```sql\n{{\n    codegen.generate_source(\n        schema_name='tpch_sf001',\n        database_name='raw',\n        generate_columns='true',\n        include_descriptions='true',\n    )\n}}\n```\n\n### codegen.generate_base_model\n\nGenerates SQL for a staging model\n```sql\n{{\n    codegen.generate_base_model(\n        source_name='tpch',\n        table_name='orders',\n    )\n}}\n```\n\n### codegen.generate_model_yaml\n\nGenerates the YAML for a given model\n```sql\n{{ \n    codegen.generate_model_yaml(\n        model_name='stg_tpch_orders'\n    )\n}}\n```\n\nGenerates the YAML for multiple models\n```sql\n{{ \n    generate_models_yaml(\n        model_names=[\n            'stg_tpch_orders',\n            'stg_tpch_parts',\n            'stg_tpch_regions',\n        ]\n    )\n}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpguthrie%2Fsnowflake-dbt-demo-new","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpguthrie%2Fsnowflake-dbt-demo-new","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpguthrie%2Fsnowflake-dbt-demo-new/lists"}