Dema
4/10/2005 3:05:00 PM
Samuel Kvarnbrink wrote:
> Well, to be accurate it is a Rails app without Active Record. Due to
> the way it's designed, AR won't work with non-SQL databases (and that
> will probably never change). However, it would be possible to create
> something that mimics AR through duck typing. But methods like
> find_by_sql would be a bit tricky, of course :)
Yes, I successfully ported AR and kept the same API to work with a RDF
database called Sesame (that doesn't work with SQL) in an academic
project. Pratically all original AR methods are there with no
modification to their signatures, although their performance and
implementation may vary a LOT.
By keeping the duck typing of the ported Base library I was able to
include almost all supporting libraries with no modifications at all,
including associations, validations, acts, aggregations, callbacks and
others.
It's doable and duck typing is a big friend.
rgds