Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nfiann-qs-for-dbtcore-duckdb #5783

Open
wants to merge 171 commits into
base: current
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 169 commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
fcdb45d
Updating doc
nataliefiann Jul 8, 2024
d99bbe8
Updating doc add steps to install duck DB
nataliefiann Jul 8, 2024
6c406b5
Added DuckDB logo
nataliefiann Jul 9, 2024
daa3664
Added DuckDB logo
nataliefiann Jul 9, 2024
dfd2d7d
Updated QS doc
nataliefiann Jul 9, 2024
9e124e9
Updated docs
nataliefiann Jul 9, 2024
82f1fab
Updated doc with tabs, changed file name and added content
nataliefiann Jul 15, 2024
b5e9e4e
Updated file name to duckdb-qs
nataliefiann Jul 15, 2024
b5f877e
Corrected grammar and punctuation
nataliefiann Jul 15, 2024
8e87af0
Added redirects
nataliefiann Jul 15, 2024
487683b
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nghi-ly Jul 16, 2024
b93d5a7
Fix build error
nghi-ly Jul 16, 2024
1a263c0
Merge branch 'nfiann-qs-for-dbtcore-duckdb' of github.com:dbt-labs/do…
nghi-ly Jul 16, 2024
737826a
Fix build error
nghi-ly Jul 16, 2024
4636a97
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nghi-ly Jul 16, 2024
71a295a
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nghi-ly Jul 16, 2024
ecc4644
trigger deploy
john-rock Jul 17, 2024
198b9ed
This branch was auto-updated!
github-actions[bot] Jul 17, 2024
596f913
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nghi-ly Jul 18, 2024
2cbd39d
Fix build error
nghi-ly Jul 18, 2024
d510e86
Merge branch 'nfiann-qs-for-dbtcore-duckdb' of github.com:dbt-labs/do…
nghi-ly Jul 18, 2024
433a233
This branch was auto-updated!
github-actions[bot] Jul 18, 2024
95da0ef
trigger rebuild
john-rock Jul 18, 2024
bc67c43
remove link to test build
john-rock Jul 18, 2024
a85abe7
revert changes
john-rock Jul 18, 2024
4bed10f
test removing redirects
john-rock Jul 18, 2024
aa47478
update redirects
john-rock Jul 18, 2024
77a9a56
adjust redirect again
john-rock Jul 18, 2024
3595de9
consolidate redirects
john-rock Jul 18, 2024
67df5d1
add redirect for step 4
john-rock Jul 18, 2024
d5a484d
move step 4 redirect up
john-rock Jul 19, 2024
3f84a70
This branch was auto-updated!
github-actions[bot] Jul 19, 2024
9bb262a
This branch was auto-updated!
github-actions[bot] Jul 20, 2024
ce37ba1
This branch was auto-updated!
github-actions[bot] Jul 21, 2024
67b118d
This branch was auto-updated!
github-actions[bot] Jul 22, 2024
cbc6d9f
This branch was auto-updated!
github-actions[bot] Jul 23, 2024
014c807
Updated tabs and changed order of guide
nataliefiann Jul 26, 2024
35da071
updating doc
nataliefiann Jul 26, 2024
3bef381
updated doc
nataliefiann Jul 29, 2024
4fe47e0
Updated intro
nataliefiann Jul 29, 2024
16f30e9
removed redirects
nataliefiann Jul 30, 2024
5be2a99
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Jul 30, 2024
8f41cd5
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Jul 30, 2024
4a6229a
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Jul 30, 2024
4f044b5
This branch was auto-updated!
github-actions[bot] Jul 30, 2024
45570bc
This branch was auto-updated!
github-actions[bot] Jul 31, 2024
13ab426
Updated intro for doc
nataliefiann Aug 1, 2024
5e11419
This branch was auto-updated!
github-actions[bot] Aug 1, 2024
01a44ba
updated doc
nataliefiann Aug 2, 2024
6447c77
This branch was auto-updated!
github-actions[bot] Aug 2, 2024
a7adfbc
This branch was auto-updated!
github-actions[bot] Aug 3, 2024
c99ee45
Updated guide
nataliefiann Aug 6, 2024
6b7c7f3
Big rocks feedback
nghi-ly Aug 6, 2024
d1a6688
This branch was auto-updated!
github-actions[bot] Aug 6, 2024
50dadb3
Indent Windows tab to align with step
nghi-ly Aug 7, 2024
838e0b2
This branch was auto-updated!
github-actions[bot] Aug 7, 2024
9eedf93
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 8, 2024
4d880c5
Cleaned up doc
nataliefiann Aug 8, 2024
7cf068b
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 8, 2024
695d074
This branch was auto-updated!
github-actions[bot] Aug 8, 2024
c12c427
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
runleonarun Aug 8, 2024
5da6811
Update website/docs/docs/get-started-dbt.md
nataliefiann Aug 9, 2024
1b290b1
This branch was auto-updated!
github-actions[bot] Aug 9, 2024
52df759
Updated doc
nataliefiann Aug 12, 2024
5318fed
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 12, 2024
f66c476
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 13, 2024
8076fee
Merge branch 'nfiann-qs-for-dbtcore-duckdb' of https://github.com/dbt…
nataliefiann Aug 13, 2024
9a90e9f
This branch was auto-updated!
github-actions[bot] Aug 13, 2024
6581ca4
Review feedback on git clone
nghi-ly Aug 14, 2024
a1a964d
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 14, 2024
6086855
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
9f05b09
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
77bc71d
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
ac1dfe9
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
d8b3160
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
2ff2a2b
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
c4f939c
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
10d6a20
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
854db28
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
eccb75b
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
5de815a
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
41e1912
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
54800e2
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
2362f8f
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
1aa255c
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
c2fea76
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
6b3f4dc
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
449e38c
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
f4e204b
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 14, 2024
2f7ec40
This branch was auto-updated!
github-actions[bot] Aug 14, 2024
9d25f13
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 15, 2024
6997420
Updated docs
nataliefiann Aug 15, 2024
4d68595
Merge branch 'nfiann-qs-for-dbtcore-duckdb' of https://github.com/dbt…
nataliefiann Aug 15, 2024
7dabecf
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 15, 2024
4c1303a
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 15, 2024
7787011
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 15, 2024
ab914d5
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 15, 2024
4d886b4
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 15, 2024
f7db06a
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 15, 2024
2b30ec9
This branch was auto-updated!
github-actions[bot] Aug 15, 2024
2458acc
Added indentation and updates
nataliefiann Aug 16, 2024
00b70da
Further indentation and updates
nataliefiann Aug 16, 2024
7990ade
Updated section 2 clone repo
nataliefiann Aug 19, 2024
eb33964
This branch was auto-updated!
github-actions[bot] Aug 19, 2024
fdfec1d
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
28db5a4
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
727e442
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
1a1ae4b
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
c2c23f8
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
b1030c9
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
1233c91
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
4881a8c
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
59c81d5
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
438ff11
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
54df96f
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
8def9ac
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
ccabf79
Update website/docs/guides/duckdb-qs.md
nataliefiann Aug 19, 2024
0a38455
Add requirements.txt section
nataliefiann Aug 20, 2024
02cb68f
Updated requirements.txt section
nataliefiann Aug 21, 2024
5019f26
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Aug 21, 2024
078ff3a
This branch was auto-updated!
github-actions[bot] Aug 21, 2024
180a391
This branch was auto-updated!
github-actions[bot] Aug 22, 2024
3313417
This branch was auto-updated!
github-actions[bot] Aug 23, 2024
7c8c13c
This branch was auto-updated!
github-actions[bot] Aug 24, 2024
530073c
This branch was auto-updated!
github-actions[bot] Aug 27, 2024
28937ab
This branch was auto-updated!
github-actions[bot] Aug 28, 2024
0dc252d
This branch was auto-updated!
github-actions[bot] Aug 29, 2024
72fef03
This branch was auto-updated!
github-actions[bot] Aug 30, 2024
0c32afa
This branch was auto-updated!
github-actions[bot] Sep 2, 2024
c040e8d
This branch was auto-updated!
github-actions[bot] Sep 3, 2024
b94f3aa
This branch was auto-updated!
github-actions[bot] Sep 4, 2024
c6e5be2
This branch was auto-updated!
github-actions[bot] Sep 5, 2024
db47202
This branch was auto-updated!
github-actions[bot] Sep 6, 2024
352ae56
This branch was auto-updated!
github-actions[bot] Sep 9, 2024
9dca2bb
This branch was auto-updated!
github-actions[bot] Sep 10, 2024
d0bb622
Update website/docs/guides/duckdb-qs.md
nataliefiann Sep 11, 2024
8b6a171
This branch was auto-updated!
github-actions[bot] Sep 11, 2024
ba3a2a1
This branch was auto-updated!
github-actions[bot] Sep 12, 2024
a279b70
This branch was auto-updated!
github-actions[bot] Sep 13, 2024
faa2190
This branch was auto-updated!
github-actions[bot] Sep 14, 2024
dadbcc4
This branch was auto-updated!
github-actions[bot] Sep 16, 2024
64772e0
This branch was auto-updated!
github-actions[bot] Sep 17, 2024
cd486de
This branch was auto-updated!
github-actions[bot] Sep 18, 2024
1d3f007
This branch was auto-updated!
github-actions[bot] Sep 19, 2024
0478509
This branch was auto-updated!
github-actions[bot] Sep 20, 2024
e963124
This branch was auto-updated!
github-actions[bot] Sep 21, 2024
164657c
This branch was auto-updated!
github-actions[bot] Sep 24, 2024
023ba09
This branch was auto-updated!
github-actions[bot] Sep 25, 2024
2d26373
This branch was auto-updated!
github-actions[bot] Sep 26, 2024
9e3fe77
This branch was auto-updated!
github-actions[bot] Sep 27, 2024
87558ce
This branch was auto-updated!
github-actions[bot] Sep 30, 2024
e8ace06
Reviewed gist changes
nataliefiann Oct 1, 2024
aba8b9f
This branch was auto-updated!
github-actions[bot] Oct 1, 2024
2eb07d0
This branch was auto-updated!
github-actions[bot] Oct 2, 2024
049b205
This branch was auto-updated!
github-actions[bot] Oct 3, 2024
e6d5bdb
This branch was auto-updated!
github-actions[bot] Oct 4, 2024
7a66355
This branch was auto-updated!
github-actions[bot] Oct 5, 2024
2539105
This branch was auto-updated!
github-actions[bot] Oct 7, 2024
af6956c
This branch was auto-updated!
github-actions[bot] Oct 8, 2024
82094b9
This branch was auto-updated!
github-actions[bot] Oct 9, 2024
f45aced
This branch was auto-updated!
github-actions[bot] Oct 10, 2024
d840eac
This branch was auto-updated!
github-actions[bot] Oct 11, 2024
9dcbb36
This branch was auto-updated!
github-actions[bot] Oct 12, 2024
aa25afd
Added redirects
nataliefiann Oct 14, 2024
1882055
Merge branch 'current' into nfiann-qs-for-dbtcore-duckdb
nataliefiann Oct 14, 2024
6d935f0
Update website/docs/guides/duckdb-qs.md
nataliefiann Oct 14, 2024
5f1b12e
Update website/docs/guides/duckdb-qs.md
nataliefiann Oct 14, 2024
c7857ed
Update website/docs/guides/duckdb-qs.md
nataliefiann Oct 14, 2024
5f7b929
Update website/docs/guides/duckdb-qs.md
nataliefiann Oct 14, 2024
814802f
Update website/docs/guides/duckdb-qs.md
nataliefiann Oct 14, 2024
105f31e
This branch was auto-updated!
github-actions[bot] Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion website/docs/docs/get-started-dbt.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Learn more about [dbt Cloud features](/docs/cloud/about-cloud/dbt-cloud-feature
Refer to the following quickstarts to get started with dbt Core:

- [dbt Core from a manual install](/guides/manual-install) to learn how to install dbt Core and set up a project.
- [dbt Core using GitHub Codespace](/guides/codespace?step=1) to learn how to create a codespace and execute the `dbt build` command.
- [dbt Core using DuckDB](/guides/duckdb?step=1) to learn how to connect to DuckDB and execute the `dbt build` command.
Copy link
Contributor

@dataders dataders Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [dbt Core using DuckDB](/guides/duckdb?step=1) to learn how to connect to DuckDB and execute the `dbt build` command.
- [dbt Core using DuckDB](/guides/duckdb?step=1) to learn how to connect to DuckDB and execute the `dbt build` command.
- [dbt Core using DuckDB (Github Codespace)](/guides/codespace?step=1) to use a pre-configued GitHub codespaces that streamlines the above quickestart's setup.


## Related docs
<!-- use as an op to link to other useful guides when the query params pr is merged -->
Expand Down
77 changes: 0 additions & 77 deletions website/docs/guides/codespace-qs.md

This file was deleted.

226 changes: 226 additions & 0 deletions website/docs/guides/duckdb-qs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
---
title: Quickstart for dbt Core using DuckDB
id: duckdb
description: "Learn to use dbt Core using DuckDB."
hoverSnippet: "Learn to use dbt Core using DuckDB."
platform: 'dbt-core'
icon: 'duckdb-seeklogo'
level: 'Beginner'
hide_table_of_contents: true
tags: ['dbt Core','Quickstart']
---

<div style={{maxWidth: '900px'}}>

## Introduction

In this quickstart guide, you'll learn how to use dbt Core with DuckDB, enabling you to get set up quickly and efficiently. [DuckDB](https://duckdb.org/) is an open-source database management system which is designed for analytical workloads. It is designed to provide fast and easy access to large datasets, making it well-suited for data analytics tasks.


This guide will demonstrate how to:

- Create a virtual development environment using a template provided by dbt Labs.
- This sets up a fully functional dbt environment with an operational and executable project. The codespace automatically connects to the DuckDB database and loads a year's worth of data from our fictional Jaffle Shop café, which sells food and beverages in several US cities.
- For additional information, refer to the [README](https://github.com/gwenwindflower/octocatalog) for the Jaffle Shop template. It includes instructions on how to do this, along with animated GIFs.
- Run any dbt command from the environment’s terminal.
- Generate a larger dataset for the Jaffle Shop café (for example, five years of data instead of just one).

You can learn more through high-quality [dbt Learn courses and workshops](https://learn.getdbt.com).


### Related content


- [DuckDB setup](/docs/core/connect-data-platform/duckdb-setup)
- [Create a GitHub repository](/guides/manual-install?step=2)
- [Build your first models](/guides/manual-install?step=3)
- [Test and document your project](/guides/manual-install?step=4)
- [Schedule a job](/guides/manual-install?step=5)


## Prerequisites

- When using DuckDB with dbt Core, you'll need to use the dbt command-line interface (CLI). Currently, DuckDB is not supported in dbt Cloud.
- It's important that you know some basics of the terminal. In particular, you should understand `cd`, `ls` , and `pwd` to navigate through the directory structure of your computer easily.
- You have a [GitHub account](https://github.com/join).

## Set up DuckDB for dbt Core

This section will provide a step-by-step guide for setting up DuckDB for use in local (Mac and Windows) environments and web browsers.

In the repository, there's a [`requirements.txt`](https://github.com/dbt-labs/jaffle_shop_duckdb) file which is used to install dbt Core, DuckDB, and all other necessary dependencies. You can check this file to see what will be installed on your machine. It's typically located in the root directory of your project.

The `requirements.txt` file is placed at the top level of your dbt project directory, alongside other key files like `dbt_project.yml`:


```shell

/my_dbt_project/
├── dbt_project.yml
├── models/
│ ├── my_model.sql
├── tests/
│ ├── my_test.sql
└── requirements.txt

```

For more information on the setup of DuckDB, you can refer to [DuckDB setup](/docs/core/connect-data-platform/duckdb-setup).

<Tabs>

<TabItem value="local" label="Local">

1. First, [clone](https://git-scm.com/docs/git-clone) the Jaffle Shop git repository by running the following command in your terminal:



```bash
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
git clone https://github.com/dbt-labs/jaffle_shop_duckdb.git

```
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
2. Change into the docs-duckdb directory from the command line:

```shell

cd jaffle_shop_duck_db

```


3. Install dbt Core and DuckDB in a virtual environment.

<Expandable alt_header="Example for Mac" >

```shell

python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
source venv/bin/activate

```
</Expandable>

<Expandable alt_header="Example for Windows" >

```shell

python -m venv venv
venv\Scripts\activate.bat
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
venv\Scripts\activate.bat

```

</Expandable>

<Expandable alt_header="Example for Windows PowerShell" >

```shell

python -m venv venv
venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
venv\Scripts\Activate.ps1

```
</Expandable>


4. Ensure your profile is setup correctly from the command line by running the following:


- [dbt compile](https://docs.getdbt.com/reference/commands/compile) &mdash; generates executable SQL from your project source files
- [dbt run](https://docs.getdbt.com/reference/commands/run) &mdash; compiles and runs your project
- [dbt test](https://docs.getdbt.com/reference/commands/test) &mdash; compiles and tests your project
- [dbt build](https://docs.getdbt.com/reference/commands/build) &mdash; compiles, runs, and tests your project
- [dbt docs generate](/reference/commands/cmd-docs#dbt-docs-generate) &mdash; generates your project's documentation.
- [dbt docs serve](/reference/commands/cmd-docs#dbt-docs-serve) &mdash; starts a webserver on port 8080 to serve your documentation locally and opens the documentation site in your default browser.

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
For complete details, refer to the [dbt command reference](/reference/dbt-commands).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be beneficial for both tabs (local and web browser) to add a screenshot or code snippet of what successful output looks like.

Copy link
Contributor

@mirnawong1 mirnawong1 Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. a shorter version of this (its too long)

(venv) ➜  jaffle_shop_duckdb git:(duckdb) dbt build
15:10:12  Running with dbt=1.8.1
15:10:13  Registered adapter: duckdb=1.8.1
15:10:13  Found 5 models, 3 seeds, 20 data tests, 416 macros
15:10:13  
15:10:14  Concurrency: 24 threads (target='dev')
15:10:14  
15:10:14  1 of 28 START seed file main.raw_customers ..................................... [RUN]
15:10:14  2 of 28 START seed file main.raw_orders ........................................ [RUN]
15:10:14  3 of 28 START seed file main.raw_payments ...................................... [RUN]
15:10:14  1 of 28 OK loaded seed file main.raw_customers ................................. [INSERT 100 in 0.19s]
15:10:14  2 of 28 OK loaded seed file main.raw_orders .................................... [INSERT 99 in 0.20s]
15:10:14  4 of 28 START sql view model main.stg_customers ................................ [RUN]
15:10:14  3 of 28 OK loaded seed file main.raw_payments .................................. [INSERT 113 in 0.21s]
15:10:14  5 of 28 START sql view model main.stg_orders ................................... [RUN]
15:10:14  6 of 28 START sql view model main.stg_payments ................................. [RUN]
15:10:14  4 of 28 OK created sql view model main.stg_customers ........................... [OK in 0.16s]
15:10:14  5 of 28 OK created sql view model main.stg_orders .............................. [OK in 0.15s]
15:10:14  7 of 28 START test not_null_stg_customers_customer_id .......................... [RUN]
15:10:14  8 of 28 START test unique_stg_customers_customer_id ............................ [RUN]
15:10:14  6 of 28 OK created sql view model main.stg_payments ............................ [OK in 0.16s]
15:10:14  9 of 28 START test accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned  [RUN]
15:10:14  10 of 28 START test not_null_stg_orders_order_id ............................... [RUN]
15:10:14  11 of 28 START test unique_stg_orders_order_id ................................. [RUN]
15:10:14  12 of 28 START test accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card  [RUN]
15:10:14  13 of 28 START test not_null_stg_payments_payment_id ........................... [RUN]
15:10:14  14 of 28 START test unique_stg_payments_payment_id ............................. [RUN]
15:10:14  7 of 28 PASS not_null_stg_customers_customer_id ................................ [PASS in 0.25s]
15:10:14  10 of 28 PASS not_null_stg_orders_order_id ..................................... [PASS in 0.22s]
15:10:14  11 of 28 PASS unique_stg_orders_order_id ....................................... [PASS in 0.22s]
15:10:14  8 of 28 PASS unique_stg_customers_customer_id .................................. [PASS in 0.26s]
15:10:14  9 of 28 PASS accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned  [PASS in 0.23s]
15:10:14  13 of 28 PASS not_null_stg_payments_payment_id ................................. [PASS in 0.22s]
15:10:14  12 of 28 PASS accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card  [PASS in 0.22s]
15:10:14  14 of 28 PASS unique_stg_payments_payment_id ................................... [PASS in 0.22s]
15:10:14  15 of 28 START sql table model main.customers .................................. [RUN]
15:10:14  16 of 28 START sql table model main.orders ..................................... [RUN]
15:10:14  16 of 28 OK created sql table model main.orders ................................ [OK in 0.13s]
15:10:14  17 of 28 START test accepted_values_orders_status__placed__shipped__completed__return_pending__returned  [RUN]
15:10:14  15 of 28 OK created sql table model main.customers ............................. [OK in 0.15s]
15:10:14  18 of 28 START test not_null_orders_amount ..................................... [RUN]
15:10:14  19 of 28 START test not_null_orders_bank_transfer_amount ....................... [RUN]
15:10:14  20 of 28 START test not_null_orders_coupon_amount .............................. [RUN]
15:10:14  21 of 28 START test not_null_orders_credit_card_amount ......................... [RUN]
15:10:14  22 of 28 START test not_null_orders_customer_id ................................ [RUN]
15:10:14  23 of 28 START test not_null_orders_gift_card_amount ........................... [RUN]
15:10:14  24 of 28 START test not_null_orders_order_id ................................... [RUN]
15:10:14  25 of 28 START test unique_orders_order_id ..................................... [RUN]
15:10:15  26 of 28 START test not_null_customers_customer_id ............................. [RUN]
15:10:15  27 of 28 START test relationships_orders_customer_id__customer_id__ref_customers_  [RUN]
15:10:15  28 of 28 START test unique_customers_customer_id ............................... [RUN]
15:10:15  17 of 28 PASS accepted_values_orders_status__placed__shipped__completed__return_pending__returned  [PASS in 0.32s]
15:10:15  19 of 28 PASS not_null_orders_bank_transfer_amount ............................. [PASS in 0.32s]
15:10:15  18 of 28 PASS not_null_orders_amount ........................................... [PASS in 0.32s]
15:10:15  21 of 28 PASS not_null_orders_credit_card_amount ............................... [PASS in 0.34s]
15:10:15  22 of 28 PASS not_null_orders_customer_id ...................................... [PASS in 0.34s]
15:10:15  20 of 28 PASS not_null_orders_coupon_amount .................................... [PASS in 0.34s]
15:10:15  24 of 28 PASS not_null_orders_order_id ......................................... [PASS in 0.34s]
15:10:15  23 of 28 PASS not_null_orders_gift_card_amount ................................. [PASS in 0.35s]
15:10:15  25 of 28 PASS unique_orders_order_id ........................................... [PASS in 0.35s]
15:10:15  26 of 28 PASS not_null_customers_customer_id ................................... [PASS in 0.31s]
15:10:15  28 of 28 PASS unique_customers_customer_id ..................................... [PASS in 0.31s]
15:10:15  27 of 28 PASS relationships_orders_customer_id__customer_id__ref_customers_ .... [PASS in 0.32s]
15:10:15  
15:10:15  Finished running 3 seeds, 3 view models, 20 data tests, 2 table models in 0 hours 0 minutes and 1.52 seconds (1.52s).
15:10:15  
15:10:15  Completed successfully
15:10:15  
15:10:15  Done. PASS=28 WARN=0 ERROR=0 SKIP=0 TOTAL=28

:::note

The steps will fail if you decide to run this project in your data warehouse (outside of this DuckDB demo). You will need to reconfigure the project files for your warehouse. Definitely consider this if you are using a community-contributed adapter.

:::


### Troubleshoot



<Expandable alt_header="Could not set lock on file error" >

```Jinja

IO Error: Could not set lock on file "jaffle_shop.duckdb": Resource temporarily unavailable

```

This is a known issue in DuckDB. Try disconnecting from any sessions that are locking the database. If you are using DBeaver, this means shutting down DBeaver (disconnecting doesn't always work).

As a last resort, deleting the database file will get you back in action (_but_ you will lose all your data).

</Expandable>


</TabItem>

<TabItem value="web" label="Web browser">

1. Go to the `jaffle-shop-template` [repository](https://github.com/gwenwindflower/octocatalog) after you log in to your GitHub account.
1. Click **Use this template** at the top of the page and choose **Create new repository**.
1. Click **Create repository from template** when you’re done setting the options for your new repository.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the instructions here updated? it says 'codespace' environment but this is for duckdb?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this Mirna, I'll shoot a message across to Anders about this

1. Click **Code** (at the top of the new repository’s page). Under the **Codespaces** tab, choose **Create codespace on main**. Depending on how you've configured your computer's settings, this either opens a new browser tab with the Codespace development environment with VSCode running in it or opens a new VSCode window with the codespace in it.
1. Wait for the codespace to finish building by waiting for the `postCreateCommand` command to complete; this can take several minutes:

<Lightbox src="/img/codespace-quickstart/postCreateCommand.png" title="Wait for postCreateCommand to complete" />

When this command completes, you can start using the codespace development environment. The terminal the command ran in will close and you will get a prompt in a brand new terminal.

1. At the terminal's prompt, you can execute any dbt command you want. For example:

```shell
/workspaces/test (main) $ dbt build
```

You can also use the [duckcli](https://github.com/dbcli/duckcli) to write SQL against the warehouse from the command line or build reports in the [Evidence](https://evidence.dev/) project provided in the `reports` directory.

For complete information, refer to the [dbt command reference](https://docs.getdbt.com/reference/dbt-commands). Common commands are:

- [dbt compile](https://docs.getdbt.com/reference/commands/compile) &mdash; generates executable SQL from your project source files
- [dbt run](https://docs.getdbt.com/reference/commands/run) &mdash; compiles and runs your project
- [dbt test](https://docs.getdbt.com/reference/commands/test) &mdash; compiles and tests your project
- [dbt build](https://docs.getdbt.com/reference/commands/build) &mdash; compiles, runs, and tests your project


</TabItem>

</Tabs>


## Generate a larger data set

If you'd like to work with a larger selection of Jaffle Shop data, you can generate an arbitrary number of years of fictitious data from within your codespace.

1. Install the Python package called [jafgen](https://pypi.org/project/jafgen/). At the terminal's prompt, run:

```shell
/workspaces/test (main) $ python -m pip install jafgen
```

1. When installation is done, run:
```shell
/workspaces/test (main) $ jafgen --years NUMBER_OF_YEARS
```
Replace `NUMBER_OF_YEARS` with the number of years you want to simulate. This command builds the CSV files and stores them in the `jaffle-data` folder, and is automatically sourced based on the `sources.yml` file and the [dbt-duckdb](/docs/core/connect-data-platform/duckdb-setup) adapter.

As you increase the number of years, it takes exponentially more time to generate the data because the Jaffle Shop stores grow in size and number. For a good balance of data size and time to build, dbt Labs suggests a maximum of 6 years.

</div>
1 change: 1 addition & 0 deletions website/static/img/icons/duckdb-seeklogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions website/static/img/icons/white/duckdb-seeklogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions website/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
"cleanUrls": true,
"trailingSlash": false,
"redirects": [
{
"source": "/guides/codespace?step=4",
"destination": "/guides/duckdb?step=3",
"permanent": true
},
{
"source": "/guides/codespace?step=3",
"destination": "/guides/duckdb?step=2",
"permanent": true
},
{
"source": "/guides/codespace?step=2",
"destination": "/guides/duckdb?step=1",
"permanent": true
},
{
"source": "/guides/codespace?step=1",
"destination": "/guides/duckdb?step=1",
"permanent": true
},
{
"source": "/docs/dbt-cloud-apis/sl-manifest",
"destination": "/reference/artifacts/sl-manifest",
Expand Down Expand Up @@ -3646,3 +3666,4 @@
}
]
}

Loading