From 923639283d2bae0b82cb605fa4680a3058c9d973 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Jul 2012 12:13:38 +0200 Subject: Add support for defining indexes New db pragma qualifier: index. New tests: common/index, mysql/index, pgsql/index. --- odb/semantics/relational/index.hxx | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'odb/semantics/relational/index.hxx') diff --git a/odb/semantics/relational/index.hxx b/odb/semantics/relational/index.hxx index af90b12..bf08a23 100644 --- a/odb/semantics/relational/index.hxx +++ b/odb/semantics/relational/index.hxx @@ -17,13 +17,42 @@ namespace semantics class index: public key { public: - index (string const& id): key (id) {} + index (string const& id, + string const& t = string (), + string const& m = string (), + string const& o = string ()) + : key (id), type_ (t), method_ (m), options_ (o) + { + } + + string const& + type () const + { + return type_; + } + + string const& + method () const + { + return method_; + } + + string const& + options () const + { + return options_; + } virtual string kind () const { return "index"; } + + private: + string type_; // E.g., "UNIQUE", etc. + string method_; // E.g., "BTREE", etc. + string options_; // Database-specific index options. }; } } -- cgit v1.1