Skip to content

Commit d79f3b2

Browse files
committed
ad hoc queries
1 parent c05da39 commit d79f3b2

1 file changed

Lines changed: 37 additions & 10 deletions

File tree

docs/examples/sqlmesh_cli_crash_course.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,43 @@ You'll use these commands to validate your changes are behaving as expected. Aud
577577
FAILED (failures=1)
578578
```
579579

580+
### Run Ad Hoc Queries
581+
582+
This is great to validate the look and feel of your changes without context switching to your query console.
583+
584+
Pro tip: run this after running `sqlmesh table_diff` to get a full picture of the changes.
585+
586+
=== "SQLMesh"
587+
588+
```bash
589+
sqlmesh fetchdf "select * from sqlmesh_example__dev.full_model limit 5"
590+
```
591+
592+
```bash
593+
-- construct arbitrary query
594+
sqlmesh fetchdf "select * from <schema__environment>.<model_name> limit 5" -- double underscore is important. Not needed for prod.
595+
```
596+
597+
=== "Tobiko Cloud"
598+
599+
```bash
600+
tcloud sqlmesh fetchdf "select * from sqlmesh_example__dev.full_model limit 5"
601+
```
602+
603+
```bash
604+
-- construct arbitrary query
605+
tcloud sqlmesh fetchdf "select * from <schema__environment>.<model_name> limit 5" -- double underscore is important. Not needed for prod.
606+
```
607+
608+
??? "Example Output"
609+
```bash
610+
item_id num_orders new_column
611+
0 9 1 7
612+
1 -11 1 7
613+
2 3 1 7
614+
3 -3 1 7
615+
4 1 4 7
616+
```
580617

581618
## **Debugging Workflow**
582619

@@ -657,17 +694,7 @@ You'll these commands ad hoc to verify your changes are behaving as expected.
657694

658695
asdf
659696

660-
=== "SQLMesh"
661697

662-
```bash
663-
sqlmesh fetchdf "select * from tcloud_demo__dev_debug.gsheets_example_v3"
664-
```
665-
666-
=== "Tobiko Cloud"
667-
668-
```bash
669-
tcloud sqlmesh fetchdf "select * from tcloud_demo__dev_debug.gsheets_example_v3"
670-
```
671698

672699
asdf
673700

0 commit comments

Comments
 (0)