From: Anders Borch Date: 2003-04-27T23:14:21+09:00 Subject: Re: serializing objects to sql Tim Bates wrote: > On Sun, 27 Apr 2003 10:43 pm, Anders Borch wrote: > >>This is nowhere near finished, but I would LOVE to get some feedback, on >>this code. Is the idea usable at all? I read some of the posts here on >>persistent objects, and some of them seem to be a lot more elegant than >>my code, but none of them let me easily use a database. > > > Have you seen db-backed[1]? It's not in the RAA for some reason (although it > is on freshmeat[2]), but it's the only thing I can find which does this to my > satisfaction. I've used it quite effectively in several projects. > > [1] http://www.zweknu.org/src/db-backed/db-backed.tar.gz > [2] http://freshmeat.net/projects/db-backed/ > > Tim Bates A very nice library indeed... it provides much of what I was missing, but I still need to do some name translations from ruby to sql table names, which I really shouldn't have to, since I already gave the class a name. Also I need to extend the db-backend classes, which is really sad, since I'd love to have my own class hierarchy. On the other hand it has nice interaction with DBI. I should use that to make my idea a little more transparent. There really is no need to hand out the sql strings when I could use a DBI object and execute them myself. db-backend - like my own try at this - has a record_id (i'm calling it sql_primaryKey - ugly but most likely not clashing with any other names). I was hoping to find some more transparent way to achieve this - though I have no idea what that could be... /anders