Skip to content

default_connection type not propagated to gateways connections #4105

Description

@martinburch

I have several gateways defined in config.yaml which are all using the same connection type.

gateways:
  local:
    connection:
      type: mssql
      host: localhost
      user: placeholder
      database: local
  staging:
    connection:
      type: mssql
      host: staging.server
      user: placeholder
      database: staging

Why can't I specify

default_connection:
  type: mssql

And have type: mssql propagate to the local and staging connections?

When I try to remove the type: mssql definitions from the gateway connections after defining type: mssql in default_connection, I get Error: Missing connection type. when running sqlmesh --gateway staging info This behaviour seems contrary to the docs: https://sqlmesh.readthedocs.io/en/stable/guides/configuration/#default-connectionsscheduler

The default_connection, default_test_connection, and default_scheduler keys are used to specify shared defaults across multiple gateways.

Activity

  1. izeigerman commented on Apr 11, 2025

    @izeigerman
    Collaborator

    What would be the point of specifying multiple gateways with the same connection?

  2. martinburch commented on Apr 11, 2025

    @martinburch
    ContributorAuthor

    Not the same connection host, but the same connection type. In my example, all my connections are to Microsoft SQL Server databases. What is the point of default_connection if not to "specify shared defaults across multiple gateways" as the docs say?

  3. izeigerman commented on Apr 21, 2025

    @izeigerman
    Collaborator

    yeah, i think there's an inaccuracy in the docs when it comes to default_connection. This is not at all how it works or is expected to work. We'll be updating the documentation.

  4. tripleaceme commented on Sep 24, 2026

    @tripleaceme
    Contributor

    I'd like to pick this up. The docs in both docs/guides/configuration.md and docs/reference/configuration.md still describe default_connection as shared defaults across gateways. I'll read through how gateways resolve their connection and update both pages to describe the actual behaviour. Could this be assigned to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

DocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions