Skip to content

Commit 8744a62

Browse files
author
Sung Won Chung
committed
better ignore cron example
1 parent 23771a2 commit 8744a62

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

docs/examples/sqlmesh_cli_crash_course.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,19 +993,44 @@ You can run models that execute backfills each time you invoke a run whether ad
993993
tcloud sqlmesh run --ignore-cron
994994
```
995995

996-
??? "Example Model Config"
996+
??? "Example Output"
997997

998-
```sql linenums="1" hl_lines="9" title="models/incremental_model.sql"
998+
```sql linenums="1" hl_lines="15" title="models/incremental_model.sql"
999999
MODEL (
10001000
name sqlmesh_example.incremental_model,
10011001
kind INCREMENTAL_BY_TIME_RANGE (
10021002
time_column event_date
10031003
),
10041004
start '2020-01-01',
1005-
cron '@daily', -- daily at midnight UTC
1005+
cron '@daily',
10061006
grain (id, event_date),
1007+
audits( UNIQUE_VALUES(columns = (
1008+
id,
1009+
)), NOT_NULL(columns = (
1010+
id,
1011+
event_date
1012+
))),
10071013
allow_partials true
10081014
);
1015+
1016+
SELECT
1017+
id,
1018+
item_id,
1019+
event_date,
1020+
16 as new_column
1021+
FROM
1022+
sqlmesh_example.seed_model
1023+
WHERE
1024+
event_date BETWEEN @start_date AND @end_date
1025+
```
1026+
1027+
```shell
1028+
[1/1] sqlmesh_example.incremental_model [insert 2025-04-19 - 2025-04-19, audits ✔2] 0.05s
1029+
Executing model batches ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 1/1 • 0:00:00
1030+
1031+
✔ Model batches executed
1032+
1033+
Run finished for environment 'prod'
10091034
```
10101035

10111036
## **Forward-Only Development Workflow**

0 commit comments

Comments
 (0)