Added serializer to interpreter

The serializer has partial specializations for all templates. It is a
good basis if the connector/database requires strings close to the
standard.

The interpreter is unspecialized (and uses a static assert to say so).
It is a good basis if the connector/database requires a different
interpretation, e.g. re-writing the expression tree.

The interpretable_t implements three methods for interpretation:
serializing with the sqlpp::serializer_context, serializing with the
database's serialization context and interpretation with the database's
interpretation context.
This commit is contained in:
rbock
2014-02-18 17:45:08 +01:00
parent 26f322b86a
commit abf4bb8e9a
65 changed files with 423 additions and 293 deletions
+5 -5
View File
@@ -31,7 +31,7 @@
DbMock db;
DbMock::_context_t printer(std::cerr);
DbMock::_serializer_context_t printer(std::cerr);
int main()
{
@@ -56,13 +56,13 @@ int main()
static_assert(sqlpp::is_regular<T>::value, "type requirement");
}
interpret(remove_from(t), printer).flush();
interpret(remove_from(t).where(t.beta != "transparent"), printer).flush();
interpret(remove_from(t).using_(t), printer).flush();
serialize(remove_from(t), printer).flush();
serialize(remove_from(t).where(t.beta != "transparent"), printer).flush();
serialize(remove_from(t).using_(t), printer).flush();
auto r = dynamic_remove_from(db, t).dynamic_using().dynamic_where();
r.add_using(t);
r.add_where(t.beta != "transparent");
interpret(r, printer).flush();
serialize(r, printer).flush();
return 0;
}