[Groonga-commit] groonga/fluent-plugin-droonga at a23a662 [master] Enable "value_type" parameter to "table_create" command

Back to archive index

Kosuke Asami null+****@clear*****
Thu Jul 11 13:03:26 JST 2013


Kosuke Asami	2013-07-11 13:03:26 +0900 (Thu, 11 Jul 2013)

  New Revision: a23a662a5aa1b7a3a65d5cbf387b586d2b766684
  https://github.com/groonga/fluent-plugin-droonga/commit/a23a662a5aa1b7a3a65d5cbf387b586d2b766684

  Message:
    Enable "value_type" parameter to "table_create" command

  Modified files:
    lib/droonga/plugin/groonga/table_create.rb
    test/plugin/groonga/test_table_create.rb

  Modified: lib/droonga/plugin/groonga/table_create.rb (+7 -0)
===================================================================
--- lib/droonga/plugin/groonga/table_create.rb    2013-07-11 10:54:48 +0900 (c1c2b3c)
+++ lib/droonga/plugin/groonga/table_create.rb    2013-07-11 13:03:26 +0900 (c164c29)
@@ -38,6 +38,7 @@ module Droonga
         options = {}
         options.merge!(parse_flags(request))
         options.merge!(parse_key_type(request))
+        options.merge!(parse_value_type(request))
         options
       end
 
@@ -70,6 +71,12 @@ module Droonga
         options[:key_type] = request["key_type"] if request["key_type"]
         options
       end
+
+      def parse_value_type(request)
+        options = {}
+        options[:value_type] = request["value_type"] if request["value_type"]
+        options
+      end
     end
   end
 end

  Modified: test/plugin/groonga/test_table_create.rb (+13 -0)
===================================================================
--- test/plugin/groonga/test_table_create.rb    2013-07-11 10:54:48 +0900 (f86b452)
+++ test/plugin/groonga/test_table_create.rb    2013-07-11 13:03:26 +0900 (1e1a167)
@@ -106,4 +106,17 @@ table_create Books TABLE_HASH_KEY --key_type Int32
       SCHEMA
     end
   end
+
+  class ValueTypeTest < self
+    def test_value_type
+      request = {
+        "name"  => "Books",
+        "value_type" => "Int32",
+      }
+      @handler.table_create(request)
+      assert_equal(<<-SCHEMA, dump)
+table_create Books TABLE_HASH_KEY --key_type ShortText --value_type Int32
+      SCHEMA
+    end
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index