Isn't there an SG11 Databases working group? https://groups.google.com/a/isocpp.org/forum/?fromgroups#!forum/databases
I don't know why, but most C++ SQL library interfaces throw all the cool things of C++ overboard. Instead they resort to text based approaches relying on the user to get it right with intense code staring and a bunch of casts or similar operations. Libraries in other languages are much more advanced here, for instance python (http://www.sqlalchemy.org/) or .NET (LINQ).
Regards,
Roland
On Tue, Jan 7, 2014 at 2:00 PM, <rb...@eudoxos.de> wrote:
> Sadly, it seems to be pretty dead. I applied for membership about two months
> ago, still pending. I also tried to get in touch with Bill Seymour, but no
> luck yet.
I think Bill Seymour stepped down and Mike Spertus is heading the SG now.
Of course it. can be used, but someone (the author of the library) has to write the paper!
--
--Hi,
Whether it makes sense to try to use the SQL expression trees for
other databases as well remains to be seen, but I guess it won't
do so in all cases :-)
Regards,
Roland
PS: I plan to write a proposal for adding something like sqlpp11
to the standard, but this is certainly a few months from now.
> I think this is a reason C++ shouldn't be trying to standardize a
> generic database access layer.
I agree.This should be done on a library level, something small and fast like CppDB.
But I think it is not possible to create a generic C++ SQL library without introspection or some special compiling step (like Protocol Buffers).So unfortunately my guess is that compiler support will be needed to make it type safe and generator-free.
> you have something like
> select(tab.alpha, tab.beta, tab.gamma).from(tab).where(tab.alpha > 7);
That would be a great syntax! Type safe and SQL injection attack safe.No string concatenation anywhere.
> sqlpp11 offers a function verbatim() which allows you to enter a strings
> for things that are not covered by the EDSL.
I would suggest calling it "unsafe_sql()" instead of "verbatim()".
class C {
public:
~C() {
transaction tr{conn};
{
transaction_scope trs{&tr};
// ... modify database. For example, by logging that an instance of "C" was destructed ...
}
}
};
void test() {
C c;
throw "Oops!";
// ~C() called, but transaction is rolled back even though no exception was thrown during the transaction!
}