There is a new player in the game which looks rather nice: (Rose::DB)
http://search.cpan.org/~jsiracusa/Rose-DB-0.0142/
I think Rose::DB::Object is the module you want. Rose::DB::Object uses Rose::DB for database abstraction, but Rose::DB doesn't model entire schemas a la Alzabo. Right now, both modules are more focused on object-relational mapping at the table, row, and column levels.
Dave Rolsky <[EMAIL PROTECTED]> writes:On Mon, 11 Apr 2005, Rob Kinyon wrote:C::DBI is too slow. (I had to search million++ row tables with multiple joins and return back in under 2 seconds on a low-midsize machine.)
FWIW, Rose::DB::Object is faster that Class::DBI for loading and saving individual rows and fetching objects referenced by foreign keys. I haven't benchmarked the multiple object searchs, but considering that Rose::DB::Object::Manager's iterator doesn't fetch all rows before starting the iteration like Class:DBI does, I suspect it'll fare well. It also supports certain kinds of joins during searches.
I find CDBI very straightforward and convenient. The docs are a bit light at times. And unfortunately there is not good handling of the vendor dependant syntax for LIMIT and GROUP BY.
Rose::DB::Object::Manager handles one oddball LIMIT syntax so far (the "FIRST ..." syntax from Informix) but only handles the standard GROUP BY syntax.
It does, however, support AbstractSearch-like stuff, including nested boolean logic (and more, e.g., searching for values inside Informix SET columns and querying columns in auto-joined tables), but with the twist that it can (optionally) parse and reformat your query values for you based on the column types they reference, or even the particulars of the object methods that service them. It's very nice to be able to be able to throw, say, DateTime objects in as query parameters, let me tell you :)
Rose::DB::Object[::Manager] also handles the auto-inlining of query values that can't be bound using some DBD drivers at this time (e.g., "CURRENT" when using DBD::Informix). Example from the POD:
CREATE TABLE test (d DATETIME YEAR TO SECOND);
INSERT INTO test (d) VALUES (CURRENT); # okay
$sth = $dbh->prepare('INSERT INTO test (d) VALUES (?)');
$sth->execute('CURRENT'); # boom! "DBD::Informix::st execute failed: SQL: -1262: Non-numeric
character in datetime or interval."That used to drive me nuts.
Anyway, I plan to create a tutorial POD for Rose::DB::Object eventually. In the meantime, please check it out. I find it very useful and pleasant to use (surprise :)
-John
_______________________________________________ sw-design mailing list [email protected] http://metaperl.com/cgi-bin/mailman/listinfo/sw-design
