diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-11 14:24:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-03-21 15:40:00 +0200 |
commit | add8086259fb21f1e42aba6546c55e607d87ce93 (patch) | |
tree | 3abbb4624d09c067236227a173e80da88948e257 /odb/relational/sqlite/schema.cxx | |
parent | a6630dff5bf2002c0c133ea6c5e16d8a0a22138f (diff) |
Infrastructure setup and schema generation for SQLite
Diffstat (limited to 'odb/relational/sqlite/schema.cxx')
-rw-r--r-- | odb/relational/sqlite/schema.cxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/odb/relational/sqlite/schema.cxx b/odb/relational/sqlite/schema.cxx new file mode 100644 index 0000000..195a71e --- /dev/null +++ b/odb/relational/sqlite/schema.cxx @@ -0,0 +1,44 @@ +// file : odb/relational/sqlite/schema.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC +// license : GNU GPL v3; see accompanying LICENSE file + +#include <odb/relational/schema.hxx> + +#include <odb/relational/sqlite/common.hxx> +#include <odb/relational/sqlite/context.hxx> + +namespace relational +{ + namespace sqlite + { + namespace schema + { + namespace relational = relational::schema; + + // + // Create. + // + struct object_columns: relational::object_columns + { + object_columns (base const& x): base (x) {} + + virtual void + constraints (semantics::data_member& m) + { + base::constraints (m); + + if (m.count ("auto")) + { + if (options.sqlite_lax_auto_id ()) + os << " /*AUTOINCREMENT*/"; + else + os << " AUTOINCREMENT"; + } + } + + }; + entry<object_columns> object_columns_; + } + } +} |