John, I looked at nstcl a bit, but AFAIK, no ideas of immediate use to
the OpenACS multi-db db_* api work there. I did the straightforward
thing - switch statements.
One, with the issue of supporting multiple drivers, nstcl is just
completely different. Not bad (as far as I saw), just very
different.
Two, nstcl still only allows you to specify a pool name to access a
different (non-default) database, there is nothing like my -dbn
switch. nstcl offers only, "To specify an alternate pool, other than
the default, preface the statement_name with the name of the pool,
followed by a colon.", e.g. "db_dml oracle:old_customers
$sql
".
In the OpenACS db_* api, if you call a db_ function while you already
have a db handle in use (e.g., inside a db_foreach loop), the api will
automagically open a second handle (and a second transaction) from a
different database pool, if you have any pools left. (See the use of
db_nth_pool_name in db_with_handle.) Whether or not this is a
good feature or not is a different question (and one that I'm
not entirely sure about), but AFAIK the db_* api has always done it
that way; it certainly has since before ACS 4.2, anyway.
For the default database, I'm not really sure whether nstcl supports
automagic multiple handles at once like that or not - I strongly
suspect it does not (see: "::nstcl::database::api_get_dbhandle"). But
nstcl definitely doesn't support it for any other database.
I don't know if Cleverly did that on purpose, or by accident. Since
there are no notes or comments about it, and his nstcl package seems
otherwise well documented, I suspect the latter.