On Sun, Mar 14, 2010 at 12:58, Nigel Hamilton <[email protected]> wrote: > Hi Lyle, > I had a laugh when I read recently that "ORM is the Vietnam of computer > science". My favourite DB module is DBIx::Simple - because you pass it SQL > and request what Perlish thing you want back. > I think its simple, transparent and honest. It does mean, however, that > sometimes there are big gobs of SQL in your code - but given that talking to > the database is one of the more expensive things a program can do I've got
Hmm, that isn't necessarily true, esp with the kind of query you have below. I thought it was the DBI docs itself but it's years since I read it; in any case there is some profiling info out there made in the context of "which is better for DBI, hash ref or rarry refs?" that showed that in pulling data out of the DB the slowest thing was mapping the data into perl hashes! Now, that isn't exactly slow, so the point being that querying a DB can be lightning fast. One of Philip Greenspun's Web 1.0 books convincingly tells a similar story. Paul > no problem with it appearing prominently. > my @account_rows = $db->query(<<'SQL', $account_type)->hashes; > > SELECT * > FROM account > WHERE account_type = ? > SQL > On the rare occasion that the SQL is really torrid I will sometimes put > it into a separate SQL template file. > > > NIge > >> _______________________________________________ >> BristolBathPM mailing list >> [email protected] >> http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm > > > > -- > NIgel Hamilton > CEO > T10 = Search Engine + Ad Network > > Turbo10 Limited, > Fairfax House, > 15 Fulwood Place, > London WC1V 6AY > T: +44 (0) 117 946 6397 > F: +44 (0) 117 923 8672 > E: [email protected] > W: http://t10.com > ---------------------------------------------------- > T10 = Search Engine + Ad Network Visit > http://t10.com > > > > _______________________________________________ > BristolBathPM mailing list > [email protected] > http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm > > _______________________________________________ BristolBathPM mailing list [email protected] http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm
