kippnorcal/sqlsorcery

MSSQL Driver Issue

Closed this issue · 7 comments

@dchess I've downloaded sqlsorcery[mssql]. Is there a way for me to send the driver as an attribute/parameter to the MSSQL() constructor? It is picking up the last driver from my pyodbc.drivers() list according to the code below:
self.driver = pyodbc.drivers()[-1].replace(" ", "+")
It works on my local machine since the last driver on my list is SQL Server, but on our server, the last driver is Oracle so it fails.

@npujararsed Unfortunately right now there isn't. I've encountered this issue as well with another user. We tend to use this exclusively in Docker where it's possible to control what drivers are installed. I'm planning on pushing out a new version of the package soon and I will include support for this.

Thank you for the quick response, @dchess! Do you have a ballpark on when this new version will be available?

@npujararsed Its part of a major overhaul so likely within the next month. In the meantime, I can likely push a patch with just this feature. If I get time this weekend I'll see if I can add it. This package is pretty niche and I'm only aware of a very small subset of users who are using it. I'm interested, where did you hear about it? And what are you using it with?

@dchess That's awesome! I found this package in another piece of code online. I looked at the documentation and it seemed like a clean way to push my data into SQL Server. I'm using it to work with data from the Tableau Server Client API.

@npujararsed I released a patch for this just now. You should be able to pass in the driver string as a param or as an env var now. Remember it needs to have the spaces replaced with a + sign. So 'ODBC Driver 17 for SQL Server' becomes 'ODBC+Driver+17+for+SQL+Server'

@dchess This is awesome! Thank you. I have a quick (silly) question, what is the new version number for this patched release? I should install it using pip install sqlsorcery[mssql]~=?

@npujararsed The new version with the patch is 0.1.5