APM: DBI helper packages

erik at debill.org erik at debill.org
Thu Sep 11 09:53:56 CDT 2003


On Thu, Sep 11, 2003 at 09:02:42AM -0500, Wayne Walker wrote:
> Does anyone have something else that they use that makes more sense?
> Remember - big ugly multiple table SELECTs.

No wonderpackage, but a couple little things that at least make the
manual bits better...

    $sth->fetchall_arrayref()

will at least get rid of the while loop.

setting 

    $dbh->{RaiseError} = 1;

means code will basically do a die() if there is a problem - so
wrapping db access in an eval saves you from having to check if the
prepare or execute failed.  At least that way you've got the error
handling all in one place (and you can print out $DBI::errstr to have
the db error for the logs).

I haven't found a great big all in one package either - but I'd love
to hear of one if someone else has.


Erik

-- 
Consumerism:  the one true path to world peace.



More information about the Austin mailing list