Forum OpenACS Development: Getting PG driver ready for ACS 4.0

I'd appreciate your help in compiling a to-do list for PG driver
supporting openACS 4.0.  What comes first to my mind is bind variable
support which should be done either on Tcl or driver level.
Where should it be put?
Next, PG7.1 can apparently handle unlimited chunks of text - can
current driver cope with that?
Collapse
Posted by Don Baccus on
Yes, bind variable support should be in the driver.

PG has been able to return large select results since PG 7.0.  In other words, though tuple size has been limited to 16KB (in a typical OpenACS installation), you can do:

select foo.*, bar.*, fubar.* from foo, bar, fubar;

where each of foo, bar, fubar contain rows of 16KB (or 8KB or 32KB) in size.  The tuple size limit only applies to tuples in tables, not to the result of a "select".

So in this area the driver should require no change.

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.

Collapse
Posted by Lamar Owen on
Way to go Dan!