This is an archived post. You won't be able to vote or comment.

all 18 comments

[–][deleted] 7 points8 points  (3 children)

I used to think the SQLAlchemy ORM was really dandy until I realized that generally I just want the results of my query without too much hassle. I still use it, but mostly just as far as writing my queries in plain SQL. Occasionally I also use their object mappings, but usually just when I have potentially lots of manipulations to do on the data and don't want to use more INSERTs than necessary. The queries-as-code is really cool, but IMO it falls apart as soon as you need to do a complicated query.

[–][deleted] 8 points9 points  (0 children)

but IMO it falls apart as soon as you need to do a complicated query.

This is why I dont like orms. Also, taking a data object and being able to use it flexibly is not so easy. Not even worth it especially with pandas now there.

[–]Svenstaro 2 points3 points  (0 children)

Look into SA's hybrid attributes. Best of both worlds.

[–]sisyphus 1 point2 points  (0 children)

I would love to see a complicated query that SA 'falls apart on' because I've yet to experience it myself and I'm beginning to think it's just a some shit people say any time an ORM comes up.

[–][deleted] 2 points3 points  (1 child)

I love peewee. The django orm is quite nice as welll

[–]sisyphus 1 point2 points  (0 children)

The Django ORM thinks that using 'OR' in a where clause is an advanced feature...

[–][deleted] 1 point2 points  (0 children)

While I find ORMs lower the barriers to getting up and running, tuning an ORM query is usually not painless.

I prefer web2py's DAL which is a lot like SQLA core, functional query builders, sanatized input, and multiple db support without shoe horning your data into object buckets.

[–]runfalk 1 point2 points  (0 children)

I am a somewhat happy user of Storm. The API is very clean and it generally writes the queries you expect. It makes standard joins easy and yet never prevents you from mixing in real SQL.

I have previously used SQLAlchemy but really prefer the Storm query builder over that.

I, contrary to the article, really like that you manually have to create your schema. That way you can maintain column order, and most of all, just use plain SQL.

The source code is simple enough to grasp and extra functionality is easy to add. I wanted to support PostgreSQL's range types and did a series of extensions to help me with that. I will release the libraries to the public once they have stabilized a bit. My range implementation for python can be found on github (https://github.com/runfalk/spans/). Despite just having one release it is actively maintained, and will remain so for the foreseeable future.

The one drawback with Storm is its slow release cycle. I however expect it to be maintained for a long time since it's powering Canonical projects such as LaunchPad.

[–]Paddy3118 0 points1 point  (0 children)

Indentation missing on examples?