|
|
|
|
|
by Virax
6137 days ago
|
|
Talk about making a mountain out of a molehill. At my company, we don't try to turn database rows into objects. Here is how it works: * we use Python+MySQL
* each table has an associated class, a CRUD-API if you will
* a cursor object accesses a table like this:
cursor.TableName.select_by_ids(low, high)
* removing means set time_removed to the current timestamp
* rows are returned as lists of dicts
So the solution to the object-relational mapping problem is: for each table, there is a class that manages access to it, and a row is represented by a a dict. |
|
Did you consider using SQLObject or SQLAlchemy? If so, I'd be curious to know why you decided against using them?