Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Things that I've used in sqlalchemy that(by a quick search) aren't in django (as far as I know):

    composite primary keys
    complex indexes (functional etc)
    arrays + json(these are in django, but I think only recently and before that in contrib)
    server side cursors
    the non-orm part(the lower layer)
    sqlalchemy-alembic (also in django, but only recently I think, still probably less features)
    server_default (define a default value for a column that will be applied to the sql-schema and not just model.field)
    more customization to the lower level db driver(psycopg2, maybe this is also supported in django)
    Use the models + library outside of your web app (ex: in several non-request-serving processes )
There are alot more features that I haven't used/don't know/didn't need.


A few minor points:

1. Django's built in migrations are essentially South 2.0 and a poster above implied that South was more featureful than Alembic. I couldn't say for sure.

2. "Use the models + library outside of your outside of your web app" - not sure why this can't be done with the Django ORM? I use the ORM for many background and batch tasks

It would be interesting to know What SQLA afficianodos think of the new goodies in Django 1.7/1.8:

https://docs.djangoproject.com/en/1.8/ref/models/conditional...

https://docs.djangoproject.com/en/1.8/releases/1.8/#query-ex...

https://docs.djangoproject.com/en/1.8/releases/1.7/#custom-l...

Obviously the main reason to love the Django ORM is it's tight integration with Django but I think nowadays it's rather undeserving of it's "SQL Alchemy's poor cousin" reputation.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: