Forum OpenACS Development: Response to Bind variable emulation in Tcl?

Collapse
Posted by Don Baccus on
We're trying to avoid the switch statement approach.  The generic 00-database-procs file contains db api code common to all RDBMS's.  The *-oracle and *-postgres files contain db api procs specialized for
the particular RDMBS.  Only the generic and the proper specialized file are sourced by the bootstrap installer.  In other words, if you're running under PostgreSQL then 00-database-procs.tcl and 00-database-procs-postgresql.tcl will be sourced.

What you should do is make a new 00-database-procs-db2.tcl (or whatever db you're planning to support) and write specialized versions of the procs and stuff them in there.

You then need to add the RDMBS name to the known db names, and add some code to bootstrap/installer including checks to make sure the right db and version's mapped to the pools, and off you go.

We don't have an approach that lets us define an 00-database-procs-odbc.tcl and then map several DB's atop it.  My guess is that there will still be DB differences, i.e. in procedural languages, that will require specialization even though they may use the generic odbc driver to connect to the RDBMS.