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/examples/sqlmesh_cli_crash_course.md
+50-1Lines changed: 50 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -679,7 +679,8 @@ This is great to catch issues before wasting runtime in your data warehouse. You
679
679
You'll use these commands ad hoc to validate your changes are behaving as expected. Audits (data tests) are a great first step, and you'll want to evolve into to feel confident about the changes. The workflow is as follows:
680
680
681
681
1. Render the model to verify the SQL is looking as expected
682
-
2. Run in debug mode to verify SQLMesh's behavior.
682
+
2. Run in verbose mode to verify SQLMesh's behavior.
683
+
3. View the logs easily in your terminal.
683
684
684
685
### Render your SQL Changes
685
686
@@ -850,6 +851,54 @@ This is useful to see exactly what SQLMesh is doing in the physical and virtual
850
851
✔ Virtual layer updated
851
852
```
852
853
854
+
### View Logs Easily
855
+
856
+
Each time you perform a SQLMesh command, it creates a log file in the `logs` directory. This is useful to see what exact queries were executed to apply your changes. Admittedly, this is outside of native functionality, but it's a quick and easy way to view the logs.
857
+
858
+
```bash
859
+
# install this open source tool that enhances the default `cat` command
860
+
brew install bat
861
+
```
862
+
863
+
```bash
864
+
bat --theme='ansi'$(ls -t logs/ | head -n 1 | sed 's/^/logs\//')
865
+
```
866
+
867
+
- In simple terms this command works like this: "Show me the contents of the newest log file in the logs directory, with nice formatting and syntax highlighting.”
868
+
- press `q` to quit out of big files in the terminal
869
+
870
+
??? "Example Output"
871
+
872
+
This is the log file for the `sqlmesh plan dev` command. If you want to see the log file directly, you can click on the file path in the output directly to open it in your code editor.
0 commit comments