Does anyone know which if any db-api 2.0 drivers work with IronPython? If so, has anyone tried using it with SQLAlchemy, SQLObject or the Django ORM?
相关问题
- How to compare dates in sqlalchemy?
- Proper way to prevent SQLAlchemy from re-running q
- sqlalchemy: TypeError: unhashable type creating in
- Get rid of double quotation marks with SQLalchemy
- “Inheriting 'Base', which is not a class”
相关文章
- In sqlalchemy, is there a way to sort so that empt
- What is the proper way to insert an object with a
- Sqlalchemy, raw query and parameters
- SQLAlchemy + alembic: create schema migration
- SQLAlchemy - Is there a way to see what is current
- Sum fields in sqlAlchemy
- SQLAlchemy StaleDataError on deleting items insert
- AttributeError: 'UUID' object has no attri
pypyodbc runs under IronPython and it's db-api 2.0 compliant. You can refer to this article to see how to enable SQLAlchemy under IronPython.
I have been able to get sqlalchemy working with MSSQL 2008 on ironpython 2.7 by following the steps here (with one change): [https://code.google.com/p/pypyodbc/wiki/Enable_SQLAlchemy_on_IronPython][1]
I had to change the last line below in step 4. removing all except pypyodbc
Step 4: Modify IronPython 2.7\Lib\site-packages\sqlalchemy\dialects\mssql__init__.py, in the top import line, add pypyodbc after mxodbc, like this:
Now you can use SQLAlchemy with below code:
I know this is a very late answer, but I only saw the question today -- so I am answering it today. http://sourceforge.net/projects/adodbapi contains a fully compliant db-api-2 module which works with IronPython. It is restricted to use in Windows, since it uses classic ADO, using COM calls, rather than ADO.NET. [I tried a true .NET version, but it worked very poorly. The fork for it is still there if anyone wants to follow up.] A fork of this module was adapted for a django extension for MS-SQL. I have pulled those adaptations back in to the main fork. I do not know whether anyone has tried using the result in django, yet, but it should work, provided one explicitly switches the paramstyle to "format".
import adodbapi as Database
Database.paramstyle = 'format'
Here's some answers for sqlalchemy:
http://groups.google.com/group/sqlalchemy/browse_thread/thread/ea3ee246680c9d14?pli=1
At the end of the thread, someone tried a beta of IronPython in September last year and it was working.
Also here: SqlAlchemy discussion.