On Sun, 2002-03-10 at 06:22, Jason E. Stewart wrote: > "Jeffrey W. Baker" <[EMAIL PROTECTED]> writes: > > > Binding is simplified: simply scan for the desired placeholder name and > > copy the value and data type. Execution is simplified because we need > > not reparse the statement. The bound values need to be quoted and > > escaped, then all the parts of the statement copied into the output > > buffer and forwarded to the database library. > > > > It sounds prety good to me, but I'd like to hear what other DBD > > maintainers think about this plan. > > Is there some reason that each individual DBD maintainer needs to > write this kind of code? To my naive ears it sounds like something > that's generally useful. Yes, different backends support different > placeholder syntax, but that ought to be something that can be made > generic and configurable in the parser, shouldn't it?
I had the same thought initially. There is probably a useful syntax supported by all drivers. But a user already familiar with PostgreSQL's syntax will expect to use the same syntax in a Perl program. PG supports /* comments */ and -- comments. Quotes are escaped with '' or \'. Using \ as the escape character requires \\ to make a real slash. A quoted literal can be replaced with its octal representation from ASCII, like \146\157\157 and so forth. MySQL doesn't support the \octal syntax, and other difference exist between databases I have not even seen. Sticking the parser into the DBD shouldn't be difficult, as long as the author doesn't punish himself too much. -jwb
