Forum OpenACS Development: Response to Getting PG driver ready for ACS 4.0

Collapse
Posted by Dan Wickstrom on
I lifted some code from the oracle driver and added bind variable support to the postgresql driver. Bind variable emulation is available through a new command called 'ns_pg_bind'. It supports getting bind variable values either from the local scope, or from a ns_set passed in with the '-bind' switch:

set foo "some value"
set selection [ns_pg_bind select $db "select bar from baz where foo = :foo"]

- or -

set bind_vars [ns_set create]
ns_set put $bind_vars foo "some value"
set selection [ns_pg_bind select $db -bind $bind_vars "select bar from baz where foo = :foo"]

Supported subcommands include select, dml, 1row, 0or1row, and exec.

The changes are checked into cvs.