Forum OpenACS Improvement Proposals (TIPs): Re: TIP #37 (Proposed): Queries in XQL file conventions

Posted by Andrew Piskorski on
Whatever you folks decide, please do not ever remove or deprecate the ability to use SQL queries inline in the Tcl code!

Inline queries are a must for development, and for all the custom development that is for one database only and is never intended to be distributed to or used by anyone but the client, there generally isn't the slightest reason to use anything but inline queries.

Personally, in hindsight I don't think using XML (rather than a Tcl syntax) for the query files was such a great choice, but all the work was done way back when, and now that tdom is so much faster than ns_xml used to be it doesn't really matter much. I certainly don't see any reason to change that now.

In my experience there's only one practical problem with the current support for the mix of inline queries and queries in various different XQL files: It's very easy to accidentally define the same query in several different places, and then the query dispatcher will silently choose one of them. If feasible, it might be best to have a configuration switch to optionally make the query dispatcher throw an error whenever it encounters multiple definitions of the same query.