Forum OpenACS Development: Re: PREPARE considered beneficial

Collapse
Posted by Don Baccus on
PGExecParams doesn't get us much without prepare. You write queries like this:
select * from foo where key = $1;
So the driver would still have to regexp the query, strip out the bind vars, map them to parameters $1 .. $N, then look up the tcl values and pass them to the query.

The advantage is that value substitution makes each query different for every set of values used with it, where parameter passing of this sort means you'd just PREPARE the query with $1 .. $N parameters.

This is only available with Protocol 3.0 so if we want driver support I think the best way may to be to provide a new driver, because the driver protocols are significantly different I believe and trying to support both in a single driver source would be messy.