Posts

Showing posts with the label orm

database ORM adaptors?

Are there any adaptors for the various python database ORM models? For example SQLObject Storm mother ORM django ORM SQLAlchemy GeniusSQL, etc. It seems this might be a good way to reuse some models, and code for those models. For example, say there was a SQLAlchemy Django ORM adaptor, then pylons, django, and turbogears could more easily inter operate. Then if an adaptor for SQLObject SQLAlchemy was made SQLObject could then use the SQLAlchemy django ORM adaptor. I guess at this point, sharing at the database level makes more sense. update : http://code.google.com/p/django-sqlalchemy/ seems to be a work-in-progress "project to create SQLAlchemy mapping of Django models onto a SQLAlchemy backend".

My issues with python ORMs

If a python ORM you know of addresses these issues, please let me know. Python ORMs break with multiple processes. Multiple processes are not assumed. Python ORMs all seem to use heavy local caching, which fails when the database is modified by another process. This is unfortunate as for me I like to use different tools for different jobs. Or there might be different people I work with that write tools in different processes. Or even the common case that each web request is run in a different process - or on a different machine. It is not commonly known that just because something outside of a python app changes a database that the python app will break. Most applications that use databases do not break if the database changes from outside of the application. Using memcache or something like it seems to be a solution to some of this problem. Also optionally allowing the ORM to not cache certain queries - or even stopping all caching. Caching using python dicts is bad anyway, bec...