princepawn has asked for the wisdom of the Perl Monks concerning the following question:
In a large system, you want all of your database queries sequestered to some sort of cached , labelled repository, accessible by name and perhaps parameterized for a few placeholder fields:
I am aware of Class:Phrasebook::SQL, but was wondering what methods you guys found useful for cataloging and storing database queries.... note the emphasis in on SELECTs as most production systems will do all database updates via PL/SQL or via some sort of batch insert at regular intervals as inserts are resource-intensive.my $records = pull_query 'wool-sweater-orders', within => 'last 5 days +'; # either finds and runs query or retrieves cached, self-expiring +result while (my $record = $records->next) { warn $record->{brand}, $record->{price}; } $records = 'all_employees', age => 26
Back to
Seekers of Perl Wisdom