mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-04-27 22:50:49 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user