in reply to LIMIT clause in Class::DBI

I don't consider SQL generation to be the biggest benefit of Class::DBI. Mostly I just like having all of the drudgery of moving stuff between objects and the database handled for me. However, if you want this and you don't want to code the SQL yourself, it's pretty easy to subclass it and add this. Just take a look at the code. Also, search the Class::DBI mailing list because others have done this before.

Replies are listed 'Best First'.
Re: Re: LIMIT clause in Class::DBI
by zby (Vicar) on Feb 18, 2004 at 10:50 UTC
    I don't quite understand what you mean by "moving stuff between objects and the database" - I thought this requires generating an "UPDATE" SQL sentence.
      That is what I'm talking about -- selecting things from the database, doing all the DBI busywork, moving it into objects, providing accessors on those objects, tracking if I change anything, saving it back to the database if I have, doing lazy-loading of groups of data, iterating over lists of primary keys and inflating them to objects if I try to use them, having a centralized place to do validation before saves, having a centralized place to do caching, etc. All of these things are done for me by Class::DBI. If I had to write every line of SQL, it would still be valuable to me.