On 17/04/2008, at 9:36 AM, Andrew Piskorski wrote:

bind variables in higher level code.  This means that the various ns*
database drivers MUST be involved in proper AOLserver bind variable
support.  Now, ns_db certainly can and should provide the various
Absolutely, the emulation I suggested would only come into play if the underlying driver does not itself implement the correct functions needed for allowing bind variables.

calls, which hook into the driver-specific code underneath, rather
than just punting completely and letting the user call driver-provided
Tcl commands directly like it does now.
Yup, that is what I would like to get rid of. ns_pg_exec is not something I would like to use. I'd like to think we are above the PHP- esque pg_connect/my_connect/pg_exec/etc!

passed allong to the proper database driver.  Therefore, the right
default approach for ns_db bind variable support is to transparently
pass through whatever bind variable syntax and usage each database and
its driver natively supports and expects.
Ah, but which is the driver, libpq or nspostgres? If comparing to JDBC and the various .NET schemes, it would be the latter, allowing for a single syntax across all databases. But it would be up to the individual drivers to comply with this standard, not for nsdb to emulate it.

To be honest, I am not a "database switcher" and don't really care all that much about being completely db independent. That said, in any case I would like to get rid of ns_pg_exec and make any command that uses bind variables or parameters (the more correct term when looking at libpq) a standard nsdb command.

So for Postgres that would be $1, $2, etc and extra parameters to the ns_db function after the SQL, for Oracle this might be using the Tcl variables if that is how it natively does it. (the OACS pg driver is already emulating Oracle, not working the way libpq does it natively) MySQL I believe only supports parameters when using prepared statements.

That brings me to another subject: do we want prepared statements? I use them all the time in JDBC, but that is simply because it is the only way add variables; I rarely re-use them unless it is some bulk data loader I am implementing.

Bas.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to