[odb-users] poco libraries support

Boris Kolpackov boris at codesynthesis.com
Mon May 21 04:42:36 EDT 2012


Hi Koray,

Koray Taylan Davgana <koraytaylan at gmail.com> writes:

> Anyways long story short, I wanted to ask that is there any plans for
> poco libraries support for odb?

By "support" I assume you mean a POCO profile for ODB.

POCO is a fairly niche library (you are the first asking about it with
regards to ODB) so we currently don't have plans to provide a profile
for it. Though if it turns out there is a lot of interest for using ODB
with POCO, we can definitely reconsider.

Having said that, this doesn't mean that you cannot use POCO with ODB
without a profile. I took a look at the examples, and it appears POCO
is using std::string for strings as well as the standard containers.
This means that simple things will work out of the box.

If you want to use more advanced ODB feaures, such as object
relationships, or certain database types, such as date-time types,
BLOBs, etc., and you want to use the "POCO way" of handling these, only
then things will start getting problematic without a POCO profile.
Specifically, you won't be able to use POCO smart pointers (AutoPtr and
SharedPtr) as object pointers. For completeness, here is the list of
mappings that a POCO profile could provide:  

Buffer             BLOB database types
Nullable           NULL values (similar to odb::nullable & boost::optional)
UUID               UUID database type
DateTime           Date-time database types

Also note that nothing prevents you from implementing ODB support for any
of these components yourself. ODB is very extensible in that sense. In
fact, there is no reason a POCO profile cannot be implemented as a third-
party library. Though if you are new to C++, then this might be a bit
too much ;-).

Boris



More information about the odb-users mailing list