Hi toby,

>If it doesn't need to be database independent then there must be many
efficient ways to code a C application against Oracle/{your db}.

True... that's why OCILIB exists :)

But implementing an underlying DB layer in a database independent framework
can be in tricky (for example : Oracle, actual libdbi driver is broken an
incomplete) and reusing existing optimized libraries (like OCILIB) is, i
think, a good thing because there is no need to reimplement the layer from
scratch.

I think, as well, that libdbi should evolve and allow the driver to provide
the data when requested by the user.
At the moment, libdbi core caches the results when the query is executed and
thus has to have a internal strong typed columns model.
It would be nice to introduce the possibility for the driver to supply
directly the data/informations.
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.
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...

What do you think, Markus ?

ps : sorry for my poor English...

Vincent.

2009/5/3 Toby Thain <t...@telegraphics.com.au>

>
> On 2-May-09, at 7:15 PM, vincent rogier wrote:
>
> No, the sqllite trick cannot be used with Oracle... And even if it was
> possible, it is not a serious option because it would kill the driver
> performance.... People are still coding DB apps  in C
>
>
> If it doesn't need to be database independent then there must be many
> efficient ways to code a C application against Oracle/{your db}.
>
> because it's faster... If a C driver has to use exotics and slow behaviors
> to work, what's the point ?
>
> The fact libdbi has to know the number of rows returned by a query, before
> any fetch,  is already a performance bottleneck for some DB, such as Oracle.
>
>
> Agreed. This is a shortcoming of the libdbi API, in my opinion.
>
>
>
> From Oracle 9i, it's possible to know that, with some big performance
> loss...(eg. Oracle 8i can't be supported)
>
> In the end, the only thing that i need to finish the ocilib based libdbi
> driver is to solve this problem of integer flags and bits..
>
> Any ideas ?
>
>
> I think the API needs to change to support streamed access to result sets,
> and loosely typed columns (I suspect we'll see more of this in the future).
>
> --Toby
> (implementor of libdbi Ingres driver)
>
>
>
> Vincent
>
>
> 2009/5/3 Markus Hoenicka <markus.hoeni...@mhoenicka.de>
>
>> vincent rogier writes:
>>  > So, i'm still suck in the ocilib based libdbo driver to set the integer
>> type
>>  > bit... For example, a column created as "INT" (4 bytes integer range)
>> or
>>  > "NUMBER" (38 digits for scale and precision that can holds integer,
>> numeric,
>>  > real, etc..) will be reported by Oracle client library (OCI) as
>> "NUMBER"...
>>  > There's no way to make nay difference...
>>  >
>>  > So my question : how to deal with that into an libdbi driver ?
>>  >
>>
>> The sqlite/sqlite3 drivers have to deal with a similar problem. sqlite
>> is essentially typeless, so you can't even distinguish between numbers
>> and text. sqlite3 has something like "sticky types" but these
>> distinguish only between text and numeric data. The sqlite/sqlite3
>> drivers have to retrieve the command which was used to create a table
>> (this is fortunately stored in each sqlite database) and figure out
>> which type to use as a return value. This approach has its problems
>> (think functions which mangle values retrieved from several columns)
>> but it mostly works ok. Would that approach be useful for an ocilib
>> based driver?
>>
>>  > PS : about the actual oracle libdbi driver : the driver can't even
>> compile
>>  > (syntax problems) and is wrong (LONG types, etc..) and buggy. I'm sure
>> no
>>  > one has tested it...
>>  >
>>
>> AFAIK there is no current oracle driver maintainer. Several people
>> have fiddled with the code in the past, but at this time hardly anyone
>> is able to even run the tests in lack of an Oracle installation. It
>> may very well be true that the driver is broken. I can't verify this.
>>
>> regards,
>> Markus
>>
>> --
>> Markus Hoenicka
>> markus.hoeni...@cats.de
>> (Spam-protected email: replace the quadrupeds with "mhoenicka")
>> http://www.mhoenicka.de
>>
>
>
>
> --
> Vincent Rogier
>
> ------------------------------------------------------------------------------
> 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
>
>
>


-- 
Vincent Rogier
------------------------------------------------------------------------------
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

Reply via email to