|
| 1 | +# Overview |
| 2 | + |
| 3 | +Realistic examples are a fantastic way to understand SQLMesh better. |
| 4 | + |
| 5 | +They allow you to tinker with a project's code and data, issuing different SQLMesh commands to see what happens. |
| 6 | + |
| 7 | +You can reset the examples at any time, so if things get turned around you can just start over! |
| 8 | + |
| 9 | +This page links to a few different types of examples: |
| 10 | + |
| 11 | +- **Walkthroughs** pose a specific story or task, and you follow along as we work through the story |
| 12 | + - Walkthroughs **do not** require running code, although the code is available if you would like to |
| 13 | + - Different walkthroughs use different SQL engines, so if you want to run the code you might need to update it for your SQL engine |
| 14 | +- **Projects** are self-contained SQLMesh projects and datasets |
| 15 | + - Projects generally use DuckDB so you can run them locally without installing or accessing a separate SQL engine |
| 16 | + |
| 17 | +!!! tip |
| 18 | + |
| 19 | + If you haven't tried out SQLMesh before, we recommending working through the [SQLMesh Quickstart](../quick_start.md) before trying these examples! |
| 20 | + |
| 21 | +## Walkthroughs |
| 22 | + |
| 23 | +We're proud to present our very first walkthrough, an in-depth description of incremental by time models: |
| 24 | + |
| 25 | +- [Incremental by time: full walkthrough](./incremental_time_full_walkthrough.md) (BigQuery SQL engine) |
| 26 | + |
| 27 | +## Projects |
| 28 | + |
| 29 | +SQLMesh example projects are stored in the [sqlmesh-examples Github repository](https://github.com/TobikoData/sqlmesh-examples). The repository's front page includes additional information about how to download the files and set up the projects. |
| 30 | + |
| 31 | +The two most comprehensive example projects use the SQLMesh `sushi` data, based on a fictional sushi restaurant. ("Tobiko" is the Japanese word for flying fish roe, commonly used in sushi.) |
| 32 | + |
| 33 | +The `sushi` data is described in an [overview notebook](https://github.com/TobikoData/sqlmesh-examples/blob/main/001_sushi/sushi-overview.ipynb) in the repository. |
| 34 | + |
| 35 | +The example repository include two versions of the `sushi` project, at different levels of complexity: |
| 36 | + |
| 37 | +- The [`simple` project](https://github.com/TobikoData/sqlmesh-examples/tree/main/001_sushi/1_simple) contains four `VIEW` and one `SEED` model |
| 38 | + - The `VIEW` model kind refreshes every run, making it easy to reason about SQLMesh's behavior |
| 39 | +- The [`moderate` project](https://github.com/TobikoData/sqlmesh-examples/tree/main/001_sushi/2_moderate) contains five `INCREMENTAL_BY_TIME_RANGE`, one `FULL`, one `VIEW`, and one `SEED` model |
| 40 | + - The incremental models allow you to observe how and when new data is transformed by SQLMesh |
| 41 | + - Some models, like `customer_revenue_lifetime`, demonstrate more advanced incremental queries like customer lifetime value calculation |
0 commit comments