i'm not sore sure about the wrapping and its expected benefits on the longer term. The closet semantics between db_* and dbi_* have probably dbi_1row/dbi_0or1row and db_1row/db_0or1row. Without a deep look i see the following differences
- dbi_* has no -dbn, but "-db" in dbi-* is probably wrappable
- dbi_* has no -cache_key and -cache_pool
- the option "-bind" is probably sufficient compatible
- the db_* option "-column_array" is probably sufficient compatible with the differently named "-array" in dbi_*
- the db_* option "-column_set" is not documented, but reading from the source, this is not implemented in dbi
- the dbi_* option "-timeout" is not available for nd_db
- the dbi_* option "-db" is not available for nd_db
- the dbi_* interface has no .xql support
- the developer support output is missing for dbi, so
one needs here as wrapper or some sandwiching;
wrapper require uplevel-ing for bindvars. - dbi* has no full sql statement (with variables substituted), since there is no such thing in dbi
- Interactions with the db_* transcation management are not clear for me, for reading operations, that should not be an issue worse that the current situation
Many of the mentioned options are seldomly used, the developer support should be done anyhow, some more issues will popup probably.
If one overwrites the two db_* functions by a version based on dbi, this "wrapper" function has to support all features used in any obscure niche in OpenACS. Furthermore, one has to install in the long range both drivers in OpenACS, since the hope to make the code fully compatible is very little. Therefore if one "recommends" to install both drivers, the code becomes harder to maintain and to test.
By moving towards higher abstractions, one has more freedom in the implementation, one can mark lower-level access as deprecated and there is a clear development direction. Also, XOTcl's mixins could be used as an extension mechanism not requiring to overwrite existing functions physically.
Antonio, what are your concerns about using ::xo::db::sql in the core? The interface and implementation is rock-stable, these functions are used in the largest OpenACS sites, xotcl is a requirement of every OpenACS installation, all the contributors of the last two years are knowledgeable in xotcl.
all the best
-gustaf