IronPython的db-api 2.0 [英] IronPython db-api 2.0

查看:115
本文介绍了IronPython的db-api 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道IronDB是否可以使用db-api 2.0驱动程序吗?如果是这样,是否有人尝试将其与SQLAlchemy,SQLObject或Django ORM一起使用?

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?

推荐答案

我知道这是一个很晚的答案,但是我今天只看到了这个问题,所以今天我要回答. http://sourceforge.net/projects/adodbapi 包含与IronPython一起使用的完全兼容的db-api-2模块.它被限制在Windows中使用,因为它使用经典的ADO,使用COM调用,而不是ADO.NET. [我尝试了一个真正的.NET版本,但是效果很差.如果有人想跟进,则它的分支仍在那儿.]此模块的分支已为MS-SQL的django扩展改编了.我已经将这些改编重新拉回到主叉上.我不知道是否有人尝试过在django中使用结果,但是只要有人将paramstyle显式切换为格式",它就可以工作.

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

将adodbapi导入为数据库

import adodbapi as Database

Database.paramstyle ='格式'

Database.paramstyle = 'format'

这篇关于IronPython的db-api 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆