diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-11 16:52:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-10-21 19:25:06 +0200 |
commit | b2f0cd834b8f5651985357f8acbe82edd7d11c63 (patch) | |
tree | 591f652e2f49631a0920828598eba4fff28fcfc8 /odb/relational/pgsql/header.cxx | |
parent | 5ff1382aeae38946889b1e09a21bde1c48475dfd (diff) |
Split 'in' binding into insert/update pair; rename 'out' to select
Also add the initial infrastructure for the readonly members support.
Right now the split insert/update bindings allows us to avoid sending
object id in UPDATE statements. It will also allows us to support
readonly members.
Diffstat (limited to 'odb/relational/pgsql/header.cxx')
-rw-r--r-- | odb/relational/pgsql/header.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/odb/relational/pgsql/header.cxx b/odb/relational/pgsql/header.cxx index 4043809..474b69c 100644 --- a/odb/relational/pgsql/header.cxx +++ b/odb/relational/pgsql/header.cxx @@ -26,12 +26,17 @@ namespace relational if (abstract (c)) return; + column_count_type const& cc (column_count (c)); + // Statement names. // os << "static const char persist_statement_name[];" - << "static const char find_statement_name[];" - << "static const char update_statement_name[];" - << "static const char erase_statement_name[];"; + << "static const char find_statement_name[];"; + + if (cc.total != cc.id + cc.inverse + cc.readonly) + os << "static const char update_statement_name[];"; + + os << "static const char erase_statement_name[];"; // Query statement name. // @@ -44,11 +49,13 @@ namespace relational // Statement types. // os << "static const unsigned int persist_statement_types[];" - << "static const unsigned int find_statement_types[];" - << "static const unsigned int update_statement_types[];" - << "static const unsigned int erase_statement_types[];" - << endl; + << "static const unsigned int find_statement_types[];"; + + if (cc.total != cc.id + cc.inverse + cc.readonly) + os << "static const unsigned int update_statement_types[];"; + os << "static const unsigned int erase_statement_types[];" + << endl; } virtual void |