Given a [mysql] database with a given schema, is it possible to generate an ORM interface for it? doesn’t matter if its php, python or perl.
in other words, I have a database and I have to ask it a few questions. while I could just craft a bunch of SQL queries (okay, several dozen), this is way more interesting to think about.
is this a valid question, even? I have no design background with ORMs, but I’ve used a few (django’s, symfony’s, etc).
Django’s ORM will do this for you (or at least it will get the process started for you).
Just set up a django app as you normally would (including DB connection settings), then do this:
I did this once to help me make sense of a legacy (php) website database that I was tasked with maintaining. It was a little work, but ultimately I was able to use the django admin site to manage it (the project was shelved, but that’s another story).
See: http://docs.djangoproject.com/en/dev/howto/legacy-databases/