vincent rogier writes: > For example, instead of using cached values (that need extra memory from > dbbdi core module while the driver sometimes already hold cached values), > the public dbdbi functions like dbi_result_get_int() could use callback to > specific drivers functions that delivers the value. > This would solve as well the problem of strong typed columns. It would be > the driver to return the value as requested, whatever the real type of the > column, making its own conversions. That's what OCILIB does. The application > requests a column value with a desired type and OCILIB makes conversion if > needed and possible.
The current cvs revision of libdbi has a lightweight variant of this approach: long long dbi_result_get_as_longlong(); long long dbi_result_get_as_longlong_idx(); char *dbi_result_get_as_string_copy(); char *dbi_result_get_as_string_copy_idx(); These functions return any value as either a long long integer or a string after converting the value returned by the database engine. Client programs can cast the integers to whatever they need. I figured this would cover the most urgent needs. > Introducing this possibility through callbacks would not break the actuals > drivers. The libdbi core could check if the driver supports this feature and > then call its functions. If not, it could work as it does now... > This is an interesting idea how to introduce this feature without breaking backwards compatibility. Thanks for sharing this. regards, Markus -- Markus Hoenicka markus.hoeni...@cats.de (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ Libdbi-drivers-devel mailing list Libdbi-drivers-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel