Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-sqlserver doesn't run on current version #25

Open
allaboutmikey opened this issue Sep 23, 2020 · 4 comments
Open

django-sqlserver doesn't run on current version #25

allaboutmikey opened this issue Sep 23, 2020 · 4 comments

Comments

@allaboutmikey
Copy link

I have been using your python-tds in all of my projects that have to connect to mssql server ever since I found it. Love the fact that it is pure python.
I am just starting with django and wanted to use sqlserver as the backend driver, but it doesn't seem to work with the current version (I have django 3.1).
The error is:
ImportError: cannot import name 'six' from 'django.utils'
If I modify that file to import six directly (it is installed as a dependency for my version of django) then I get:
AttributeError: module 'six' has no attribute 'memoryview'
Is the project still being maintained? If there are no plans to update it, would you be willing to offer any guidance on how it can be done?

@Wedge009
Copy link

I am also wondering if this project is still maintained/supported, since its last release was in 2017. I am considering python-tds due to its ability to handle the 'fail-over partner' connection parameter, but it looks like the integration with Django is no longer maintained...

@allaboutmikey
Copy link
Author

I have used python-tds quite extensively with and without django over the last few years. It seems to do the job very well. When using django, I just use the sql query functions of python-tds directly instead of using the django integration.
I have gone away from all the "easy" sql substitutes, not just with django either. I find a couple of lines of code to get to my result set (of native python data types) much easier to maintain and comprehend than any of the ORMs. If you're not an SQL user already, this may not work for you.

@Wedge009
Copy link

Thanks for replying to a 4-year old issue! I can use SQL where I need to but would prefer to let Django do most of the work. Unfortunately the choice to go with MS SQL Server wasn't mine, so I've been struggling a bit as a result. Aside from the 'fail-over' function, mssql-django has been sufficient for what I've been working on.

@denisenkom
Copy link
Owner

I have an idea to trick mssql-django package to use python-tds instead of pyodbc by creating a shim package that presents itself as pyodbc but internally just forwards calls to python-tds. That should be the most maintainable way to add Django support since mssql-django already does all of the heavy lifting for generating MSSQL compatible queries. If somebody is interested to give it a try let me know, if not I will try to find time to look into it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants