Skip to content

Support for Hyperscale (Azure Microsoft SQL Server) #3503

@TroelsL

Description

@TroelsL

There are subtle differences between on-prem SQL Server and the cloud version, but also one massive one.

I am unable to use SQLMesh against our Azure databases due to this. Digging briefly into the code, it appears that this method is a cause of the problem:

https://github.com/TobikoData/sqlmesh/blob/main/sqlmesh/core/engine_adapter/mssql.py ln 152

    def set_current_catalog(self, catalog_name: str) -> None:
        self.execute(exp.Use(this=exp.to_identifier(catalog_name)))

On a cloud DB, it is not possible to issue USE statements, but rather you should connect directly to the database needed.

Trying SQLMesh on hyperscale, leads to the following error:

(40508, b'USE statement is not supported to switch between databases. Use a new connection to connect to a different database.DB-Lib error message 20018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')

Is there a way to configure my way out of this, or would it require a major change in SQLMesh?

Metadata

Metadata

Assignees

Labels

FeatureAdds new functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions