pymssql and pyodbc support added (#1625)

This commit is contained in:
Ayush Shah 2021-12-08 21:36:13 +05:30 committed by GitHub
parent 7263510124
commit d5e13a9d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,8 +19,16 @@ class MssqlConfig(SQLConnectionConfig):
host_port = "localhost:1433"
scheme = "mssql+pytds"
service_type = "MSSQL"
use_pymssql: bool = False
use_pyodbc: bool = False
uri_string: str = ""
def get_connection_url(self):
if self.use_pyodbc:
self.scheme = "mssql+pyodbc"
return f"{self.scheme}://{self.uri_string}"
elif self.use_pymssql:
self.scheme = "mssql+pymssql"
return super().get_connection_url()