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
Organizations typically connect to a data warehouse through a single engine to ensure data consistency. However, there are cases where the processing capabilities of one engine may be better suited to specific tasks than another.
4
+
5
+
By decoupling storage from compute and with growing support for open table formats like Apache Iceberg and Hive, different engines can now interact with the same data.
6
+
7
+
With SQLMesh's new multi-engine feature, users can leverage multiple engine adapters within a single project, offering the flexibility to choose the best engine for each task.
8
+
9
+
This feature allows you to run each model on a specified engine, provided the data catalog is shared and the engines support read/write operations on it.
10
+
11
+
12
+
## Configuring project with multiple engines
13
+
14
+
To configure a SQLMesh project with multiple engines, simply include all required gateway [connections](../reference/configuration.md#connection) in your configuration.
15
+
16
+
Next, specify the appropriate `gateway` in the `MODEL` DDL for each model. If no gateway is explicitly defined, the default gateway will be used.
17
+
18
+
The [virtual layer](../concepts/glossary.md#virtual-layer) will be created within the engine corresponding to the default gateway.
19
+
20
+
### Example
21
+
22
+
Below is a simple example of setting up a project with connections to both DuckDB and PostgreSQL.
23
+
24
+
In this setup, the PostgreSQL engine is set as the default, so it will be used to manage views in the virtual layer.
25
+
26
+
Meanwhile, the DuckDB's [attach](https://duckdb.org/docs/sql/statements/attach.html) feature enables read-write access to the PostgreSQL catalog's physical tables.
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.
Copy file name to clipboardExpand all lines: docs/reference/model_configuration.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ Configuration options for SQLMesh model properties. Supported by all model kinds
37
37
|`session_properties`| A key-value mapping of arbitrary properties specific to the target engine that are applied to the engine session. Specified as key-value pairs (`key = value`). | dict | N |
38
38
|`allow_partials`| Whether this model can process partial (incomplete) data intervals | bool | N |
39
39
|`enabled`| Whether the model is enabled. This attribute is `true` by default. Setting it to `false` causes SQLMesh to ignore this model when loading the project. | bool | N |
40
+
|`gateway`| Specifies the gateway to use for the execution of this model. When not specified, the default gateway is used. | str | N |
0 commit comments