New paper: N3612, Desiderata of a C++11 Database Interface -- Thomas Neumann

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3612

Date: 2013-03-15

Desiderata of a C++11 Database Interface

by Thomas Neumann

Excerpt:

With the recent papers N3415 and N3458 two proposals have been made for a standard database interface in the C++ standard, based upon C++11 features. In addition, a wide range of C++98 database interfaces already exist. Before designing just another interface, we therefore discuss the desirable properties or requirements of a database interface. In the following we classify these requirements in three rough groups, from high-level to low-level. It might not be feasible to fulfill all of these in one unified interface, therefore the group order also roughly implies importance. Afterwards we give a rough classification of existing interfaces according to the desired properties.

Add a Comment

Comments are closed.

Comments (1)

0 0

tortoise74 said on Apr 2, 2013 06:12 AM:

As posted to the google group:

With regards to "N3612: Desiderata of a C++11 Database Interface",
the paper provides a useful review of several existing libraries but focuses on important low level use cases rather than higher level abstractions.
I believe a missing requirement is the easy creation of object relational mapping classes. This was a key consideration for me in evaluating DTL
(partly as response to comments from java programmers using the JPA suggesting it was not possible in C++)
For example I can define a structure like:

struct MyQueryResultType
{
SomeType1 columnA;
SomeType2 columnB;
};

and a mapping (a BCA in DTL parlance):

MyQueryResultType rowBuffer;

BCA(rowbuffer,
COLS["columnA"] >> rowBuffer.columnA &&
COLS["columnB"] >> rowBuffer.columnB)

This is enough to specify how to translate the database's types to and from suitable C++ types. These mappings can be provided or overloaded for individual queries to maximise performance, for example by mapping C++ types to thier most closely matching
database counterparts. Likewise generic mappings to less efficient but more convenient types like strings can occur automagically.