Storing SQL Queries for Reuse in Apps
| From: | Jacob C | Date: | Fri, 11 Jul 2003 00:20:07 +0000 |
| Subject: | Storing SQL Queries for Reuse in Apps | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-154811@lists.php.net to get a copy of this message | ||
Hello All,
I just want to survey the list and see what kind of solutions people are using
for the storage and reuse of SQL queries.
Right now I am working on an application that has native SQL queries as well
as custom queries that can be added by developers as they build on the
framework.
In the past I have done several things to store large sets of SQL queries.
Some are better than others and some just shouldn't be used (hardcoded):
- Hardcoded into the application (written into classes or procedural code as
needed).
- Stored in a delimited text file.
- Placed into a function or class method using switch to iterate by category
and ID.
- Stored in an XML file.
I am kind of leaning towards the XML solution since the native queries can
then easily be updated for people using the application. Of course using XML
adds execution time and complexity to the app.
Anybody have any other solutions I haven't thought of or trick/tweaks to the
ones I have listed?
Thanks!
Jacob
--
"If there's a World War III, World War IV will be fought with sticks and
stones."