473,728 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQLObject or SQLAlchemy?

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.
Aug 31 '06 #1
20 3907

John Salerno wrote:
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.
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.

Aug 31 '06 #2
Adam Jones wrote:
I think SA's extra flexability
is worth the effort.
Thanks for the reply. Do you mean in the above quote that SA is a little
more complicated than SO?
Aug 31 '06 #3

John Salerno wrote:
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.
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.
Just my 2 cents.

Aug 31 '06 #4

John Salerno wrote:

Thanks for the reply. Do you mean in the above quote that SA is a little
more complicated than SO?
Don't be afraid to download them and try their respective tutorials.
Each one would take about an hour and then you'd have a feel for
yourself. I agree with adam that SQLAlchemy has far more features and
flexibility.

SQLObject would be very great and convenient if you were throwing up a
website that you knew would never require high volumne.

SA does have an IRC group. It's not incredibly lively but at least
there is one.

Aug 31 '06 #5
John Salerno a écrit :
Are there any major differences between these two?
Yes. SQLAlchemy is, mainly, a very higher-level DB-API that makes
working with a RDBMS almost transparent (no embedded SQL unless you
really wants to) without trying to pretend there's no RDBMS nor forcing
you into ORM mode. ORM facilities are built on top of this.
It seems they can
both be used with TurboGears, and SQLAlchemy with Django. I'm just
wondering what everyone's preference is, and why,
I'd say SQLAlchemy. I've used Django's ORM (pre 'magic-removal' version)
and played a bit with SQLObject, but after an afternoon playing with
SQLAlchemy and browsing the doc, I don't wan't to hear of them anymore.
and if there are even
more choices for ORM.
There is. But nothing as exceiting as SQLAlchemy IMHO. Now FWIW,
installing and testing is probably the quickest way to make your own
opinion.

Aug 31 '06 #6

John Salerno wrote:
Adam Jones wrote:
I think SA's extra flexability
is worth the effort.

Thanks for the reply. Do you mean in the above quote that SA is a little
more complicated than SO?
Yes, it is. To avoid the technical issues involved the complication can
be summarized as: SQLAlchemy implements the Data Mapper pattern, of
which the Active Record pattern (which SQLObject implements) is a
subset.

SO makes a few assumptions about your tables (like that it will have
single immutable primary keys for all tables) which make it difficult
to work with an existing database. It also does not have the ability to
compile multiple queries into a single unit of work for processing, at
least not on the same level that SA does. Given that SA can support
more complex data models, is better for supporting pre-existing
databases, and usually is faster. After you have learned it you have a
better tool all around. That said it is more complicated, and if what
you are doing is not high traffic and does not require extremely
complex data models SO is still an excellent choice.

Aug 31 '06 #7
I think this post by the author of SQLAlchemy perfectly summarizes the
differences between the two ORMs:

http://article.gmane.org/gmane.comp....emy.user/1072/

--
mvh Björn
Sep 1 '06 #8
"BJörn Lindqvist" <bj*****@gmail. comwrites:
I think this post by the author of SQLAlchemy perfectly summarizes the
differences between the two ORMs:

http://article.gmane.org/gmane.comp....emy.user/1072/
And ActiveMapper is working to some extent better than it was by the time of
the post :-)

--
Jorge Godoy <jg****@gmail.c om>
Sep 1 '06 #9
On 8/31/06, John Salerno <jo******@nospa mgmail.comwrote :
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.
they use two approach to the same problem.

SO tries to tide each object to a table while
SA lets you do the mapping.

so each one has it's pros and cons.

for example SA wins at using an existing db
but SO wins at not worring about the db structure

SO demands tables to have a primary single col int key which is manage
by the API, while SA lets you mess with it a bit more.

so you could say that SO takes care about many things so you don't
have to worry about them, or other may say SO is too intrusive.

In my experience SO is great for new projects and if you don't want to
mess/optimize with the actual SQL queries (which is great for an ORM
because IMO that is the main goal of ORMing)

Now if you need to mess a lot with the db (either a existing one or
need optimized queries) then SA is worth the extra effort, since
making those things on SO is going uphill.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Sep 1 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1633
by: Robin Munn | last post by:
I've been loving SQLObject. The ability to set up a database connection and then completely *forget* about it and just manipulate Python objects has been great. But I'm running into a problem, and I'd like some advice. I'm writing an app using SQLite as the database backend, and interfacing to it via SQLObject. I have all my SQL table definitions (classes inheriting from SQLObject) in one module, and for simplicity's sake I'm using a...
0
1170
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0b1 release of SQLObject. This is the first beta of the new branch. Taking into account that it is a result of rather large job the beta period will be prolonged. Meanwhile the stable 0.7 branch will be maintained, and there will be at least 0.7.3 release. What is SQLObject =================
3
1135
by: Daniel Nogradi | last post by:
Hi list, I get loads of DeprecationWarnings while using sqlobject 0.8.0b1 with python 2.5. Does this mean that the sqlobject project is not very up to date? Or should I just ignore them and happily use it? In general, what's the status of sqlobject, will it be dropped altogether after sqlobject2 is out? Anyone's experience with this version of sqlobject would be very helpful. Since I'm starting to use sqlobject right now, if there is a
3
1296
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0b2 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be
0
1259
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be
3
1376
by: Sean DiZazzo | last post by:
Hi all, I am just beginning with TurboGears and have run into a problem with SQLObject. I'm trying to connect to an established mysql DB, and use TurboGears to display results from the DB only. The problem is that the DB already has an 'id' field that is a string as opposed to an int. SQLObject complains because it wants to use the id field for it's own purposes.
4
1482
by: petr.jakes.tpc | last post by:
Hi, inspired by the article written by Tarek Ziade in the February 07 issue of the "Linux +" magazine I am experimenting with the doctest module. I have two files, "displeje_pokus.py" and "displeje_pokus.txt" (you can see the simplified contents of the files bellow). When I run "python displeje_pokus.py" I am getting an error (see
3
938
by: bruce | last post by:
hi.... i'm playing around, researching sqlobject, and i notice that it appears to require the use of "id" in each tbl it handles in the database. if i already have a db schema, and it doesn't use 'id' as an auto-generated field, does that mean that i can't use/implement sqlobject. is there a way to overide this function/behavior...
0
1106
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.10.0b1, the first beta release of a new SQLObject branch, 0.10. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described
0
8895
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8755
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9267
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9191
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8117
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6012
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4523
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4787
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2159
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.