On Jun 20, 2:09 pm, "Rick Morrison" <[EMAIL PROTECTED]> wrote:
> The SA MSSQL module currently supports the three DBAPI modules mentioned
> above (pyodbc, pymssql, adodbapi).
>
> You'll need to either get one of those three to import under IronPython, or
> add support for the IPCE adaptor.
pyodbc, pymssql, and adodbapi each use binary modules, so they would
require some (unknown amount of) conversion to work with IronPython.
I wrapped a module around the IPCE adaptor module to meet (more of)
the DBAPI 2.0 module level requirements, and duplicated the pyodbc
code in databases/mssql.py to use my module.
That got me an error on the Table('users', metadata, ... line from the
tutorial:
Traceback (most recent call last):
File D:\Software\IronPython\dbTest\test_sa.py, line 83, in
Initialize
File D:\Software\IronPython\dbTest\test_sa.py, line 80, in main
File D:\Software\IronPython\dbTest\test_sa.py, line 52, in
test_users_table
File schema, line unknown, in __call__
File D:\Downloads\Python\SQLAlchemy-0.3.8\Lib\sqlalchemy\schema.py,
line 156, in __call__
File , line 0, in Make##135
TypeError: Cannot convert _TableSingleton(<class
'sqlalchemy.schema.Table'>) to String
This error looks like it might be due to a difference in the type
systems between C-Python and IronPython, previously reported as
http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7594
That IronPython work item is currently scheduled for the 2.0 alpha 2
release. Note that the community can vote for problems to be fixed on
the Codeplex site.
Here is my wrapper module, which I called ipodbc.py:
import dbapi
import odbc as db
dbapi._load_type(db.assembly,db.typename)
def connect(connectStr):
return = db.connect(connectStr)
apilevel = '2.0'
threadsafety = 0
paramstyle = 'qmark'
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---