You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/engines/motherduck.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,32 @@
1
1
# MotherDuck
2
2
3
-
This page provides information about how to use SQLMesh with MotherDuck.
3
+
This page provides information about how to use SQLMesh with MotherDuck.
4
4
5
5
It begins with a [Connection Quickstart](#connection-quickstart) that demonstrates how to connect to MotherDuck, or you can skip directly to information about using MotherDuck with the built-in scheduler.
6
6
7
7
## Connection quickstart
8
8
9
9
Connecting to cloud warehouses involves a few steps, so this connection quickstart provides the info you need to get up and running with MotherDuck.
10
10
11
-
It demonstrates connecting to MotherDuck with the `duckdb` library bundled with SQLMesh.
11
+
It demonstrates connecting to MotherDuck with the `duckdb` library bundled with SQLMesh.
12
12
13
13
MotherDuck provides a single way to authorize a connection. This quickstart demonstrates authenticating with a token.
14
14
15
-
!!! tip
15
+
!!! tip
16
16
This quick start assumes you are familiar with basic SQLMesh commands and functionality.
17
17
18
-
If you’re not familiar, work through the [SQLMesh Quickstart](../../quick_start.md) before continuing.
18
+
If you’re not familiar, work through the [SQLMesh Quickstart](../../quick_start.md) before continuing.
19
19
20
20
### Prerequisites
21
21
22
22
Before working through this quickstart guide, ensure that:
23
23
24
-
1. You have a motherduck account and an access token.
25
-
2. Your computer has SQLMesh installed with the DuckDB extra available.
26
-
1. Install from command line with the command `pip install “sqlmesh[duckdb]”`
27
-
3. You have initialized a SQLMesh example project on your computer
28
-
1. Open a command line interface and navigate to the directory where the project files should go.
29
-
2. Initialize the project with the command `sqlmesh init motherduck`
24
+
1. You have a motherduck account and an access token.
25
+
2. Your computer has SQLMesh installed with the DuckDB extra available.
26
+
1. Install from command line with the command `pip install “sqlmesh[duckdb]”`
27
+
3. You have initialized a SQLMesh example project on your computer
28
+
1. Open a command line interface and navigate to the directory where the project files should go.
29
+
2. Initialize the project with the command `sqlmesh init duckdb`, since `duckdb` is the dialect.
30
30
31
31
#### Access control permissions
32
32
@@ -38,30 +38,32 @@ We now have what is required to configure SQLMesh’s connection to MotherDuck.
38
38
39
39
We start the configuration by adding a gateway named `motherduck` to our example project’s config.yaml file and making it our `default gateway`, as well as adding our token, persistent, and ephemeral catalogs.
40
40
41
-
```yaml
42
-
gateways:
43
-
motherduck:
44
-
connection:
45
-
type: motherduck
46
-
catalogs:
47
-
persistent: ‘md:’
48
-
ephemeral: ‘:memory:’
49
-
token: \<your\_token\>
50
-
51
-
default\_gateway: motherduck
41
+
```yaml
42
+
gateways:
43
+
motherduck:
44
+
connection:
45
+
type: motherduck
46
+
catalogs:
47
+
persistent: "md:"
48
+
ephemeral: ":memory:"
49
+
token: <your_token>
50
+
51
+
default_gateway: motherduck
52
52
```
53
53
54
+
Catalogs can be defined to connect to anything that [DuckDB can be attached to](./duckdb.md#other-connection-catalogs-example).
55
+
54
56
!!! warning
55
57
Best practice for storing secrets like tokens is placing them in [environment variables that the configuration file loads dynamically](../../guides/configuration.md#environment-variables). For simplicity, this guide instead places the value directly in the configuration file.
56
58
57
59
This code demonstrates how to use the environment variable `MOTHERDUCK_TOKEN` for the configuration's `token` parameter:
0 commit comments