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/guides/configuration.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -869,7 +869,7 @@ See [here](https://sqlglot.com/sqlglot/dialects/dialect.html#NormalizationStrate
869
869
870
870
You can also define gateway specific `model_defaults` in the `gateways` section, which override the global defaults for that gateway.
871
871
872
-
```yaml linenums="1"
872
+
```yaml linenums="1" hl_lines="6 14"
873
873
gateways:
874
874
redshift:
875
875
connection:
@@ -891,9 +891,9 @@ This allows you to tailor the behavior of models for each gateway without affect
891
891
892
892
For example, in some SQL engines identifiers like table and column names are case-sensitive, but they are case-insensitive in other engines. By default, a project that uses both types of engines would need to ensure the models for each engine aligned with the engine's normalization behavior, which makes project maintenance and debugging more challenging.
893
893
894
-
Gateway-specific `model_defaults` allow you to change how SQLMesh performs identifier normalization *by engine* to align the different engines' behavior.
894
+
Gateway-specific `model_defaults` allow you to change how SQLMesh performs identifier normalization *by engine* to align the different engines' behavior.
895
895
896
-
In the example above, the project's default dialect is `snowflake` (line 14). The `redshift` gateway configuration overrides that global default dialect with `"snowflake,normalization_strategy=case_insensitive"` (line 6).
896
+
In the example above, the project's default dialect is `snowflake` (line 14). The `redshift` gateway configuration overrides that global default dialect with `"snowflake,normalization_strategy=case_insensitive"` (line 6).
897
897
898
898
That value tells SQLMesh that the `redshift` gateway's models will be written in the Snowflake SQL dialect (so need to be transpiled from Snowflake to Redshift), but that the resulting Redshift SQL should treat identifiers as case-insensitive to match Snowflake's behavior.
Copy file name to clipboardExpand all lines: docs/guides/multi_engine.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,8 +97,6 @@ In this setup, the PostgreSQL engine is set as the default, so it will be used t
97
97
)
98
98
```
99
99
100
-
Given this configuration, when a model’s gateway is set to duckdb, it will be materialized within the PostgreSQL `main_db` catalog, but it will be evaluated using DuckDB’s engine.
101
-
102
100
Given this configuration, when a model’s gateway is set to DuckDB, the DuckDB engine will perform the calculations before materializing the physical table in the PostgreSQL `main_db` catalog.
103
101
104
102
```sql linenums="1"
@@ -139,7 +137,7 @@ First, add the connections to your configuration and set the `gateway_managed_vi
139
137
140
138
=== "YAML"
141
139
142
-
```yaml linenums="1"
140
+
```yaml linenums="1" hl_lines="30"
143
141
gateways:
144
142
redshift:
145
143
connection:
@@ -178,7 +176,7 @@ variables:
178
176
179
177
=== "Python"
180
178
181
-
```python linenums="1"
179
+
```python linenums="1" hl_lines="48"
182
180
from sqlmesh.core.config import (
183
181
Config,
184
182
ModelDefaultsConfig,
@@ -255,7 +253,7 @@ FROM
255
253
256
254
For the `athena_schema.order_status` model, we explicitly specify the `athena` gateway:
257
255
258
-
```sql linenums="1"
256
+
```sql linenums="1" hl_lines="4"
259
257
MODEL (
260
258
name athena_schema.order_status,
261
259
table_format iceberg,
@@ -271,7 +269,7 @@ FROM
271
269
272
270
Finally, specifying the `snowflake` gateway for the `customer_orders` model ensures it is isolated from the rest and reads from a table within the Snowflake database:
0 commit comments