Skip to content

Commit c1f3ce0

Browse files
docs: clarify that default connections are not merged into gateways (#6089)
Signed-off-by: Adegbite Ayoade <tripleaceme@gmail.com> Co-authored-by: Cortland Goffena <30168413+cmgoffena13@users.noreply.github.com>
1 parent 7975a8d commit c1f3ce0

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎docs/guides/configuration.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,10 +1213,12 @@ Example configuration:
12131213

12141214
#### Default connections/scheduler
12151215

1216-
The `default_connection`, `default_test_connection`, and `default_scheduler` keys are used to specify shared defaults across multiple gateways.
1216+
The `default_connection`, `default_test_connection`, and `default_scheduler` keys specify a connection or scheduler for gateways that do not define their own.
12171217

12181218
For example, you might have a specific connection where your tests should run regardless of which gateway is being used. Instead of duplicating the test connection information in each gateway specification, specify it once in the `default_test_connection` key.
12191219

1220+
A default is only used when a gateway omits the corresponding key entirely. If a gateway specifies its own `connection`, `test_connection`, or `scheduler`, SQLMesh uses that configuration as written and ignores the default. Fields are not merged, so a gateway connection cannot inherit individual fields such as `type` from `default_connection`. Each gateway connection must be a complete connection configuration.
1221+
12201222
Example configuration specifying a Postgres default connection, in-memory DuckDB default test connection, and builtin default scheduler:
12211223

12221224
=== "YAML"

‎docs/reference/configuration.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,15 @@ If a configuration contains multiple gateways, SQLMesh will use the first one in
264264

265265
### Default connections/scheduler
266266

267-
The `default_connection`, `default_test_connection`, and `default_scheduler` keys are used to specify shared defaults across multiple gateways.
267+
The `default_connection`, `default_test_connection`, and `default_scheduler` keys specify a connection or scheduler for gateways that do not define their own.
268268

269269
For example, you might have a specific connection where your tests should run regardless of which gateway is being used. Instead of duplicating the test connection information in each gateway specification, specify it once in the `default_test_connection` key.
270270

271+
A default is only used when a gateway omits the corresponding key entirely. If a gateway specifies its own `connection`, `test_connection`, or `scheduler`, SQLMesh uses that configuration as written and ignores the default. Fields are not merged, so a gateway connection cannot inherit individual fields such as `type` from `default_connection`.
272+
271273
| Option | Description | Type | Required |
272274
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | :---------: | :------: |
273-
| `default_connection` | The default connection to use if one is not specified in a gateway (Default: A DuckDB connection that creates an in-memory database) | connection | N |
275+
| `default_connection` | The connection to use for any gateway that does not specify a `connection` | connection | N |
274276
| `default_test_connection` | The default connection to use when running tests if one is not specified in a gateway (Default: A DuckDB connection that creates an in-memory database) | connection | N |
275277
| `default_scheduler` | The default scheduler configuration to use if one is not specified in a gateway (Default: built-in scheduler) | scheduler | N |
276278

0 commit comments

Comments
 (0)