Skip to content

sqlmesh format requires DB connection #5182

Closed

Description

@lucargir

When using the sqlmesh CLI to format the project, it tries to connect to a DB. Given that I am using it as part of PR tests to make sure the code is properly formatted, there's no need for external connections. Would it be possible to drop this requirement?

Activity

  1. j-hartshorn commented on May 21, 2026

    @j-hartshorn
    Contributor

    We have encountered something similar too; format is failing in CI because it's trying to authenticate with GCP. Formatting shouldn't need to connect or auth at all.

  2. j-hartshorn commented on Jun 12, 2026

    @j-hartshorn
    Contributor

    PR #5804 makes sqlmesh format runnable without a reachable state backend.

    Unfortunately I couldn't make the lint command follow suit because it needs the remote state to resolve reference in the m multi-repo case. Details are in the PR discussion. some possible follow ups if anyone wants to take a look:

    • Attempt the state connection and fall back, documenting that this might cause linter errors.
    • Allow an explicit flag for lint to make it ignore state, documenting that this may cause extra linting errors to appear in the multi-repo case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions