Boost logo

Boost :

From: Maciej Sobczak (prog_at_[hidden])
Date: 2006-01-16 07:55:50


Sebastian Redl wrote:

>>2. A plug-in architecture for backends, which allows to target various
>>database engines by simply linking with the chosen backend.
>>Currently, the following database engines are supported (through their
>>respective "native" interface):
>
> The library looks very nice, and I might spend more time with it in the
> near future.
> I have one main question: what, if any, are the facilities of SOCI to
> hide database-specific details, or how could the current design
> accommodate such facilities?

There is an "isolating" layer in SOCI, marked as the "Common interface"
on this page:

http://soci.sourceforge.net/doc/structure.html

> For example, if I were to write a MySQL backend, there are several
> differences in regards to datatypes from Oracle and the relatively easy
> portable PostgreSQL.

There is a fixed set of "base" datatypes (integer, string, time, etc.),
which are identified by enums defined in soci-common.h. The actual
backend needs to map those "base" types to whatever is available on the
target server.

The user-defined types can also be used with SOCI, in a variety of ways
- but their conversion rules are always defined in terms of those "base"
datatypes.

-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk