[OPEN-ILS-DEV] OpenILS::Util::StoredProc
Galen Charlton
gmc at esilibrary.com
Mon Dec 20 12:04:22 EST 2010
Hi,
I propose that we carve out a namespace for Perl code to be used in stored procedures. My idea is that OpenILS::Util::StoredProc (or whatever it gets called; I'm not entirely happy with that name) would be installed on Evergreen database servers and that most PL/PERL(U) functions would just be thin wrappers to routines defined in that module. This would give us a few nice things:
[1] It would allow us to remove at least two known cases of code duplication (naco_normalize and arguably entityize) and removes a vector for future code duplication.
[2] It would make it easier to write test cases for Perl stored procedures, at least for functionality that doesn't actually care that it's running as a stored procedure. This applies to most of the PL/Perl stored procedures currently in use, i.e., those that just manipulate strings or MARC::Record objects.
[3] It reduces the possibility that the definition of a Perl stored procedure would vary between the SQL script that installs it and the schema update script(s).
The trade-offs would be:
[1] This adds another moving part during installation and upgrade, particularly for multi-server setups, and could lead to hard-to-debug problems if one forgets to update OpenILS::Util::StoredProc on the database server.
[2] It adds another level of indirection to wade through during debugging.
Regards,
Galen
--
Galen Charlton
VP, Data Services
Equinox Software, Inc. / Your Library's Guide to Open Source
email: gmc at esilibrary.com
direct: +1 352-215-7548
skype: gmcharlt
web: http://www.esilibrary.com/
More information about the Open-ils-dev
mailing list