Benefits of elixir vs declarative sqla

223 views
Skip to first unread message

chaouche yacine

unread,
Oct 18, 2010, 7:21:58 AM10/18/10
to sqle...@googlegroups.com
Hello,

I found some bits here :

http://groups.google.com/group/sqlelixir/browse_thread/thread/b4dab712e0f8e590/6541865e401a004d?hl=en&lnk=gst&q=benefits#6541865e401a004d

and here :

http://www.mail-archive.com/sqlal...@googlegroups.com/msg10483.html

I wonder of anybody compiled the total in a nice check list to persuade my hierarchy that elixir is :
* simplifying my life
* making my code look more OO
* is semantically more "clear" when dealing with relations

I just need arguments and (cerise sur le gâteau) code comparisons showing both the elixir version and the sqla version.

To be fair, this comparison should also show how sqla has now evolved and includes some nice features too that was missing on the earlier versions, and this making elixir just another way to express it without any "value added" anymore.

This requires some time to compile, so if any of you have has some interesting bits on his side they are very welcome.

Here's a first list I compiled on my side. I wonder if all claims are true (most claims *suggest* that elixir does this, sqla don't), so your opinions are welcome :

* Elixir implements the Active Record Pattern and is intended to replace the ActiveMapper SQLAlchemy extension. (out dated : sqlalchemy caught up ?)
* Relations b/w models are clear(er) : OneToMany, ManyToOne, ManyToMany and OneToOne is clearer than sqla's relation. At a glance, you can see the relations b/w your models.
* Inhertience is more convinient than in sqlalchemys. It is also more visible since you derive from classes. In sqla, you'll have to tweak with_polymorphisme and polymorphic_on attributes.
* Inhertience : in elixir, tables, columns, and foreign keys are created automatically, but not in sqlalchemy. (is it 100% true ?)
* Elixir automatically creates an ID column for all tables (if no other primary_key is declared)
* Elixir creates FK for relations automatically, sql does not (?)
* In elixir, most of times, you don't have to specify the backref in you relations. In sqla, you always have to (?)
* Elixir has a versionning extension (sql haven't ?)
* Elixir has an associable extension that creates ManyToMany relations and provides nice select_by_XXX methods where XXX is the name of the "associated" class. Sqla dosen't have this kind of extension (?)
* Inherting relations is done transparently in Elixir. In sqla, it's not, you have to do this : http://www.sqlalchemy.org/docs/reference/ext/declarative.html#mixing-in-relationships)


Any comments really appreciated.

Y.Chaouche



Reply all
Reply to author
Forward
0 new messages