[ANN] ODB C++ ORM 1.6.0 released, adds object projections
I am pleased to announce the release of ODB 1.6.0.
ODB is an open-source object-relational mapping (ORM) system for C++. It
allows you to persist C++ objects to a relational database without having
to deal with tables, columns, or SQL and without manually writing any of
the mapping code.
The major new feature in this release is the introduction of the view
concept. A view is a light-weight, read-only projection of one or more
persistent objects or database tables or the result of a native SQL query
Views can be used to load a subset of data members from objects or columns
from database tables, execute and handle results of arbitrary SQL queries,
including aggregate queries, as well as join multiple objects and/or
database tables using object relationships or custom join conditions.
For example, given this persistent class:
#pragma db object
#pragma db id auto
unsigned long id_;
std::string first_, last_;
unsigned short age_;
We can define a view that returns the number of people stored in the
#pragma db view object(person)
#pragma db column("count(" + person::id_ + ")")
And then use this view to find out how many people are younger than 30:
ODB is written in portable C++ and you should be able to use it with any
modern C++ compiler. In particular, we have tested this release on GNU/Linux
(x86/x86-64), Windows (x86/x86-64), Mac OS X, and Solaris (x86/x86-64/SPARC)
with GNU g++ 4.2.x-4.6.x, MS Visual C++ 2008 and 2010, and Sun Studio 12.
The currently supported database systems are MySQL, SQLite, and PostgreSQL.
This release has also been tested with the recently released PostgreSQL 9.1.
ODB also provides profiles for Boost and Qt, which allow you to seamlessly
use value types, containers, and smart pointers from these libraries in
your persistent classes.
More information, documentation, source code, and pre-compiled binaries are