testing sqlmesh

This commit is contained in:
Deeman
2025-07-27 00:18:03 +02:00
parent f0de8a505b
commit 9baa0d185c
11 changed files with 20 additions and 76 deletions

View File

@@ -1,24 +1,27 @@
# --- Gateway Connection ---
gateways:
duckdb:
dev:
connection:
# For more information on configuring the connection to your execution engine, visit:
# https://sqlmesh.readthedocs.io/en/stable/reference/configuration/#connection
# https://sqlmesh.readthedocs.io/en/stable/integrations/engines/duckdb/#connection-options
type: duckdb
database: db.db
# concurrent_tasks: 1
# register_comments: True
# pre_ping: False
# pretty_sql: False
# catalogs:
# extensions:
# connector_config:
# secrets:
# filesystems:
# token:
database: materia_dev_db.db
extensions:
- name: zipfs
default_gateway: duckdb
prod:
connection:
# For more information on configuring the connection to your execution engine, visit:
# https://sqlmesh.readthedocs.io/en/stable/reference/configuration/#connection
# https://sqlmesh.readthedocs.io/en/stable/integrations/engines/duckdb/#connection-options
type: duckdb
database: materia_prod_db.db
extensions:
- name: zipfs
default_gateway: dev
# --- Model Defaults ---
# https://sqlmesh.readthedocs.io/en/stable/reference/model_configuration/#model-defaults

Binary file not shown.

View File

@@ -1,15 +0,0 @@
MODEL (
name sqlmesh_example.full_model,
kind FULL,
cron '@daily',
grain item_id,
audits (assert_positive_order_ids),
);
SELECT
item_id,
COUNT(DISTINCT id) AS num_orders,
FROM
sqlmesh_example.incremental_model
GROUP BY item_id

View File

@@ -1,19 +0,0 @@
MODEL (
name sqlmesh_example.incremental_model,
kind INCREMENTAL_BY_TIME_RANGE (
time_column event_date
),
start '2020-01-01',
cron '@daily',
grain (id, event_date)
);
SELECT
id,
item_id,
event_date,
FROM
sqlmesh_example.seed_model
WHERE
event_date BETWEEN @start_date AND @end_date

View File

@@ -1,13 +0,0 @@
MODEL (
name sqlmesh_example.seed_model,
kind SEED (
path '../seeds/seed_data.csv'
),
columns (
id INTEGER,
item_id INTEGER,
event_date DATE
),
grain (id, event_date)
);

View File

@@ -1,5 +1,5 @@
[project]
name = "sqlmesh-materia"
name = "sqlmesh_materia"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
@@ -11,8 +11,6 @@ dependencies = [
"sqlmesh>=0.200.0",
]
[project.scripts]
plan = "sqlmesh plan"
[build-system]
requires = ["hatchling"]

View File

@@ -1,8 +0,0 @@
id,item_id,event_date
1,2,2020-01-01
2,1,2020-01-01
3,3,2020-01-03
4,1,2020-01-04
5,1,2020-01-05
6,1,2020-01-06
7,1,2020-01-07
1 id item_id event_date
2 1 2 2020-01-01
3 2 1 2020-01-01
4 3 3 2020-01-03
5 4 1 2020-01-04
6 5 1 2020-01-05
7 6 1 2020-01-06
8 7 1 2020-01-07