SQLObject或SQLAlchemy? [英] SQLObject or SQLAlchemy?

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

问题描述

这两者之间有什么重大差异吗?似乎他们可以将

用于TurboGears,而SQLAlchemy用于Django。我只是

想知道每个人的偏好是什么,为什么,如果ORM还有更多的选择。

谢谢。

Are there any major differences between these two? It seems they can
both be used with TurboGears, and SQLAlchemy with Django. I''m just
wondering what everyone''s preference is, and why, and if there are even
more choices for ORM.

Thanks.

推荐答案



John Salerno写道:

John Salerno wrote:

这两者之间有什么重大差异吗?似乎他们可以将

用于TurboGears,而SQLAlchemy用于Django。我只是

想知道每个人的偏好是什么,为什么,如果ORM还有更多的选择。

谢谢。
Are there any major differences between these two? It seems they can
both be used with TurboGears, and SQLAlchemy with Django. I''m just
wondering what everyone''s preference is, and why, and if there are even
more choices for ORM.

Thanks.



目前我的大部分工作都是在SQLObject中完成的,因为当我启动项目时它很稳定

。在所有情况下,我都可以想到

我将使用SQLAlchemy的新项目。即使对于那些支持我正在使用的关系模型的项目,我认为SA的额外灵活性

值得付出努力。

Currently most of my work is done in SQLObject because it was stable
when I started the project I am on. In all the cases I can think of for
a new project I would use SQLAlchemy. Even for projects where SO
supports the relational model I am using I think SA''s extra flexability
is worth the effort.


Adam Jones写道:
Adam Jones wrote:

我认为SA的额外灵活性

值得付出努力。
I think SA''s extra flexability
is worth the effort.



感谢您的回复。你是说在上面的引用中说SA有点比b更复杂吗?

Thanks for the reply. Do you mean in the above quote that SA is a little
more complicated than SO?




John Salerno写道:

John Salerno wrote:

这两者之间有什么重大差异吗?似乎他们可以将

用于TurboGears,而SQLAlchemy用于Django。我只是想知道每个人的偏好是什么,以及为什么,甚至还有更多的ORM选择。
Are there any major differences between these two? It seems they can
both be used with TurboGears, and SQLAlchemy with Django. I''m just
wondering what everyone''s preference is, and why, and if there are even
more choices for ORM.



我昨晚刚刚完成了两个网站的冲浪,这里是

我收集的内容


- 我不明白为什么SQLObject不能与Django一起使用


- SQLAlchemy不仅仅是一个ORM。它可以这样使用。我不知道

为什么你必须两次明确告诉它相关的表格。

你在第一次定义表元数据时这样做:
http://www.sqlalchemy.org/docs/tutor..._relationships


但是当你必须打电话给关系时:
http://www.sqlalchemy.org/docs/tutor..._relationships


它会似乎一个或另一个已足够并且必须同时执行两个操作是多余的...继续进行比较


- SQLObject清楚地说明了它只支持带有

单列主键的表格


- 可以自行加入


- SQLAlchemy支持连接池


- 当您需要加载大量记录时,ORMS会变慢。 SQLAlchemy具有

使用模式,可在作业调用时加载海量数据集。

I just finished surfing both websites last night myself and here is
what I glean

-- I dont see why SQLObject could not be used with Django

-- SQLAlchemy is not just an ORM. It can be used that way. I dont know
why you have to explicitly tell it about related tables twice though.
You do it the first time when defining table metadata:
http://www.sqlalchemy.org/docs/tutor..._relationships

but when you have to make a call to relation as well:
http://www.sqlalchemy.org/docs/tutor..._relationships

It would seem that one or the other is enough and having to do both is
redundant... continuing with the comparison

-- SQLObject makes it clear that it only has support for tables with a
single-column primary key

-- tha can both do self-joins

-- SQLAlchemy has support for connection pooling

-- ORMS get slow when you need to load a lot of records. SQLAlchemy has
usage modes to load massive data sets when the job calls for it.


>

谢谢。
>
Thanks.



只需2美分。

Just my 2 cents.


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

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