Python和Sybase [英] Python and Sybase

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

问题描述

最适合从Python访问Sybase的模块是什么?这个

one: http: //www.object-craft.com.au/projects/sybase/sybase/


此外,是否有任何模块提供通用数据库API,可以是

挂钩了Sybase和postgresql?这个

http:// www。 python.org/peps/pep-0249.html )看起来很旧。

解决方案



David> ;最适合从Python访问Sybase的模块是什么模块?

David>这一个: http://www.object-craft。 com.au/projects/sybase/sybase/

David> ?


如果我没有记错的话,我认为这是唯一的一个,除非某种ODBC

的东西。


David>此外,是否有任何模块提供通用DB API,并且可以

David>被钩到Sybase和postgresql?这个

David> ( http://www.python.org/peps/pep-0249 .html )看起来很旧。


关于如何访问关系数据库没有太多变化

PEP最终确定。你认为某些东西'缺失了吗?b $ b或做错了吗?如果是这样,我认为 db****@python.org 列表仍然存在

和好吧。


Skip


2004年9月23日星期四14:50:04 -0400,David Rysdam< dr * ****@ll.mit.edu>写道:

最适合从Python访问Sybase的模块是什么?这个
一个: http:// www。 object-craft.com.au/projects/sybase/sybase/


Object-Craft'是迄今为止我发现的最好的。

此外,是否有任何提供通用DB API的模块并且可以挂钩到Sybase和postgresql?这个
http://www.python.org/ peps / pep-0249.html )看起来很旧。




你为什么需要它? Python有一个数据库API,所以你需要做的就是从bb变为db的
是连接字符串。


conn = Sybase.connection(。 ....)

conn = otherModules.connection(....)

外翻其他应该以同样的方式工作。


-Josh


David Rysdam< dr ***** @ ll.mit.edu>写道:

最适合从Python访问Sybase的模块是什么?
这一个: http://www.object-craft.com.au/projects/sybase/sybase/


据我所知,这是唯一一个。


此外,是否有任何提供通用DB API的模块并且可以挂钩到Sybase和postgresql?这个
http://www.python.org/ peps / pep-0249.html )看起来很旧。




不是一个模块 - 你为什么要一个?


DB API(版本2)是标准。 DB API的想法是

使得编写跨多个

数据库后端的DB API代码成为可能。完全不需要单个模块,只需一个

标准。不幸的是,使这项工作并非完全无足轻重:

有一些愚蠢的问题是DB API的错 - 特别是SQL

参数替换语法 - 和一些比较棘手的问题

- 特别是DBMSes功能的变化。如果你想要你的代码在多个DBMS后端工作,那么你应该从一开始就用这些DBMS测试它们的b $ b。稍后再做是可能的,但是

可能很难(如果你保留你的数据库代码那么难以实现
本地化)。

John


What module is most recommended for accessing Sybase from Python? This
one: http://www.object-craft.com.au/projects/sybase/sybase/ ?

Also, is there any module that provides a generic DB API and can be
hooked to both Sybase and postgresql? This
(http://www.python.org/peps/pep-0249.html) looks pretty old.

解决方案


David> What module is most recommended for accessing Sybase from Python?
David> This one: http://www.object-craft.com.au/projects/sybase/sybase/
David> ?

If I''m not mistaken, I think that''s the only one, barring some sort of ODBC
stuff.

David> Also, is there any module that provides a generic DB API and can
David> be hooked to both Sybase and postgresql? This
David> (http://www.python.org/peps/pep-0249.html) looks pretty old.

There hasn''t been that much change to how relational databases are accessed
in the time since that PEP was finalized. Do you think something''s missing
or was done wrong? If so, I think the db****@python.org list is still alive
and well.

Skip


On Thu, 23 Sep 2004 14:50:04 -0400, David Rysdam <dr*****@ll.mit.edu> wrote:

What module is most recommended for accessing Sybase from Python? This
one: http://www.object-craft.com.au/projects/sybase/sybase/ ?
Object-Craft''s is the best one I''ve found so far.

Also, is there any module that provides a generic DB API and can be
hooked to both Sybase and postgresql? This
(http://www.python.org/peps/pep-0249.html) looks pretty old.



Why would you need that? Python has a DB API, so all you have to do to
change from db to db is the connection string.

conn = Sybase.connection(.....)
conn = otherModules.connection(....)

Everthing else should work the same way.

-Josh


David Rysdam <dr*****@ll.mit.edu> writes:

What module is most recommended for accessing Sybase from Python?
This one: http://www.object-craft.com.au/projects/sybase/sybase/ ?
As far as I know, that''s the only one.

Also, is there any module that provides a generic DB API and can be
hooked to both Sybase and postgresql? This
(http://www.python.org/peps/pep-0249.html) looks pretty old.



Not a single module -- why would you want one?

The DB API (version 2) is the standard. The idea of the DB API is to
make it possible to write DB API code that works across multiple
database backends. No need at all for a single module, just a single
standard. Unfortunately, making this work is not entirely trivial:
There are some stupid issues that are the fault of the DB API -- SQL
argument substitution syntax in particular -- and some trickier ones
-- particularly the variations in the capabilities of DBMSes. If you
want your code to work across multiple DBMS backends, you should test
it with those DBMSes from the start. Doing it later is possible but
may be hard work (made less difficult if you keep your DB code
localised).
John


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

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