|
Boost : |
Subject: Re: [boost] [GSOC] Are we going to participate?
From: Roland Bock (rbock_at_[hidden])
Date: 2013-02-14 04:40:18
On 2013-02-14 06:04, Michael Marcin wrote:
> - relational database library (what ever happened with boost and soci?)
FYI:
I am currently working on a C++11 SQL library. Once you declare your
table structures in C++, it will allow you to express queries very close
to SQL: For example:
TabSample t;
auto results = sql::select(sql::distinct, t.b, t.c)
.from(t)
.where(t.a > 7 and t.b != "cheesecake")
.order_by(t.c).run(db);
for (auto row: results)
{
int a = row.a;
std::string c = row.c;
}
The library will take care of escaping (to prevent code injection), the
compiler will enforce type safety (e.g. disallow comparison of integral
and string values). There will also be a lot of sanity checks at compile
time, for instance you cannot call .from() twice. It will even be able
to tell you, if you are referencing tables, which are missing in
.from(), etc.
No more string concatenation and hoping to get the syntax right. The
compiler will tell you, if you do it wrong.
No more indexed access to string results. Result rows will allow you to
access individual columns by name (and they will have a decent type).
Since yesterday evening, I have a something close to a proof of concept
for select expressions (which I think are the hardest), including the
ability to use sub-selects.
Personally, I think this has the potential of becoming a boost library
one day, but I guess I will need a few more weeks before I even dare to
present a very first draft (to try to attract co-authors). I don't think
I am ready to turn this into a GSoC project, yet.
Regards,
Roland
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk