kippnorcal / sqlsorcery

Dead simple wrapper for pandas and sqlalchemy
https://sqlsorcery.readthedocs.io/en/latest/
MIT License
2 stars 1 forks source link

MSSQL Driver Issue #31

Closed npujararsed closed 4 years ago

npujararsed commented 4 years ago

@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.

dchess commented 4 years ago

@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.

npujararsed commented 4 years ago

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

dchess commented 4 years ago

@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?

npujararsed commented 4 years ago

@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.

dchess commented 4 years ago

@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'

npujararsed commented 4 years ago

@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]~=?

dchess commented 4 years ago

@npujararsed The new version with the patch is 0.1.5