On Apr 16, 2008, at 8:33 PM, Jeff Rogers wrote:
Bas Scheffers wrote:

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!

Considering how easy tcl makes such things, I'm rather surprised oacs doesn't do something like
rename ns_db _ns_db
proc ns_db {args} {
 if {[is_postgres]} {
   eval ns_pg_exec $args
 } else {
   eval _ns_db $args
 }
}

For that matter this parameter/bind var we're talking about could be implemented in the near term as a compatible extension to ns_db through exactly this channel.

Our db api manages handles and transactions, for one thing.

But deep down in the guts it does:

                switch $driverkey {
                    oracle {
return [eval [list ns_ora $type $db -bind $bind $sql] $args]
                    }
                    postgresql {
return [eval [list ns_pg_bind $type $db -bind $bind $sql]]
                    }
                    nsodbc {
return [eval [list ns_odbc_bind $type $db - bind $bind $sql]]
                    }

The oracle call is different because LOBS are kludged through the driver due to OCI weirdness.

----
Don Baccus
http://donb.photo.net
http://birdnotes.net
http://openacs.org


--
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