-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from carbonfact/motherduck
Handle MotherDuck
- Loading branch information
Showing
8 changed files
with
96 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Using MotherDuck | ||
|
||
lea works with DuckDB, and thus can be used with [MotherDuck](https://motherduck.com/) too. | ||
|
||
Here is an example `.env` file: | ||
|
||
```sh | ||
echo " | ||
LEA_USERNAME=max | ||
LEA_WAREHOUSE=duckdb | ||
LEA_DUCKDB_PATH=md:jaffle_shop | ||
LEA_MOTHERDUCK_TOKEN=<provided by MotherDuck> | ||
" > .env | ||
``` | ||
|
||
The token can be obtained by logging into MotherDuck from the terminal, as documented [here](https://motherduck.com/docs/getting-started/connect-query-from-python/installation-authentication#authenticating-to-motherduck). | ||
|
||
Then, you can run the usual commands. For the sake of example, let's re-use the jaffle shop views: | ||
|
||
```sh | ||
lea prepare ../jaffle_shop/views | ||
``` | ||
|
||
``` | ||
Created schema analytics | ||
Created schema staging | ||
Created schema core | ||
``` | ||
|
||
```sh | ||
lea run ../jaffle_shop/views | ||
``` | ||
|
||
You should see the views in your MotherDuck UI: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "lea-cli" | ||
version = "0.2.3" | ||
version = "0.2.4" | ||
description = "A minimalist alternative to dbt" | ||
authors = ["Max Halford <[email protected]>"] | ||
packages = [ | ||
|
@@ -12,15 +12,20 @@ python = ">=3.10" | |
sqlglot = "^18.10.0" | ||
Jinja2 = "^3.1.2" | ||
typer = "^0.9.0" | ||
google-cloud-bigquery = "^3.11.4" | ||
db-dtypes = "^1.1.1" | ||
requests = "^2.31.0" | ||
python-dotenv = "^1.0.0" | ||
rich = "^13.5.3" | ||
tabulate = "^0.9.0" | ||
pandas-gbq = "^0.19.2" | ||
duckdb = "^0.9.0" | ||
|
||
[tool.poetry.group.duckdb.dependencies] | ||
duckdb = "^0.9.1" | ||
|
||
[tool.poetry.group.bigquery.dependencies] | ||
google-cloud-bigquery = "^3.11.4" | ||
db-dtypes = "^1.1.1" | ||
pandas-gbq = "^0.19.2" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
ipykernel = "^6.21.2" | ||
pytest = "^7.4.2" | ||
|