From: Kirk Haines Date: 2004-02-13T14:58:48+09:00 Subject: Re: Avi Bryant's Kansas package? On Fri, 13 Feb 2004, Avi Bryant wrote: > Feel free to do whatever you like with that code. It was even more of > a hack than IOWA - literally an evening or two's work, so don't expect > too much from it. I would be surprised if there weren't better O/R > mapping tools for Ruby out there by now, but I haven't kept up. Oh, > and make sure you have the version with PragDave's modifications (if > you pulled it from CVS you should have them). Yes, what I have is what you had in the Iowa CVS. What I like about it is it's lightweight simplicity. There are _definitely_ areas where the library needs to be fleshed out a bit for robustness, but my initial experiments with it show it working pretty well after some light modifications to make it work with preexisting database connections so that I could use my db connection pooling. 99% of my database accesses are pretty simplistic interactions. Given a key, pull one or more records from a table, with only occasional joins between two tables. And the only _real_ hassle that I've had using SQL and manipulating query results directly is one of convenience. I don't like having to explicitly maintain two seperate representations of table data -- one in the database and one in some Struct declaration so that I have an object to put query results into. It's ugly and a pain in the butt sometimes. All I really want from a package is for it to do the work of looking at a table and making a usable object representation, and for it to give me a simple way of making queries and getting the results back in one of those object representations. If there is a better or more mature package for Ruby that does this in a lightweight way, I'd love to know about it. If not, though, I'll clean up and strengthen Kansas a bit and be happy with it. It's basically all that I want. > Most recently I've been experimenting with the idea of modelling the > relational algebra directly as (in my case) first class Smalltalk > expressions, so that you can compose and iterate over SQL queries in > an object oriented way instead of through string manipulation - kind > of like Criteria but more rigorous and (I think) more flexible. It's > pretty nifty. I've blogged about it a couple of times: > http://www.cincomsmalltalk.com/userblogs/avi/blogView?searchCategory=databases That's really interesting. I'll have to read it again in the morning, though, and see if my brain can parse the Smalltalk examples better. Thanks, Kirk Haines