Boost logo

Boost :

Subject: Re: [boost] sqlpp11, 3rd iteration
From: Roland Bock (rbock_at_[hidden])
Date: 2014-08-18 14:52:07

On 2014-08-18 18:56, Robert Ramey wrote:
> Roland,
> Get documentation into your package so we can include it in "Library Writers
> Workshop"
> Robert Ramey

I'll see what I can come up with until then. As written in another
thread, I am not sure yet how to document the library in a more formal
way. The statements' interface change while being used (not really, of
course, but it kind of behaves that way). Here are a few examples (the
first one will compile with the current development branch, the others
will compile with any recent release):

auto x = select(sqlpp::value(7).as(sqlpp::alias::a));

x is a statement that has a bunch of member functions like from(),
where(), having(), etc, but none of those are required to be called. You
can let this be executed by the database as is.

auto y = select(all_of(t)); // t being a table

y is a statement that has the same member functions, but two of them are
required to execute the statement: from() and where(). I.e.

db(y); // This will trigger two static asserts
db(y.from(t).where(true)); // This will compile


auto z = select(all_of(t)).from(t).where( == "XX");

z is a statement that can be executed by a database. It does not have
the methods from() and where() anymore. You can call having(),
group_by(), etc, though.

This behaves really smoothly, but I don't know how to formally document
it yet.



Boost list run by bdawes at, gregod at, cpdaniel at, john at