-
Notifications
You must be signed in to change notification settings - Fork 358
Description
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?