Ian Bicking: the old part of his blog


One way to get around the "hardcoded connection" problem would be to allow a TALES expression to be evaluated to specify the connection object. I remember suggesting this a while back, and promptly forgetting about it because I don't really use ZSQL Methods.

I agree with your assessment. I am apparently going to be using SQL on a project pretty soon, so maybe I can help try to fix some of the lower-hanging problems whilst I do that if my needs become more than trivial.
Comment on Z SQL Rant
by Chris McDonough


ZSQL does indeed really hurt one's soul to use, in its current state (for anything behind the most basic lookup). It hurts me to say this even, because I think it really is such a great idea: to apply a template-like solution to the problems of generating dynamic SQL. I find the concept much nicer than programmatic SQL generation (leaving aside the topic of ORMs).

But in this case unfortunately we are stuck with DTML. And a rather limited DTML toolkit at that, as has bee noted. I could even live with the extreme ugliness of DTML if only it had the more robust expressiveness required for doing more complicated SQL generation --- as has been ranted about many places. And, as also noted, the extreme neglect that ZSQL has received. There are some good patches out there that are completely ignored.

I have been trying to think of (and i'm not the first) a more TAL-like approach, applied to SQL. It's not so easy since SQL is a rather different beast than markup. Also one does (in my opinion) need to employ logic and conditionals in your SQL templates, where they should try to be avoided as much as possible in presentation templates.

Ah well.. maybe someday someone will think of/do something.

# Tim Middleton