Kouhei Sutou
null+****@clear*****
Fri Feb 3 17:31:34 JST 2017
Kouhei Sutou 2017-02-03 17:31:34 +0900 (Fri, 03 Feb 2017) New Revision: 0dc3b5d741d7ff7b056de71b8cf9b85e59a96e21 https://github.com/ranguba/groonga-client/commit/0dc3b5d741d7ff7b056de71b8cf9b85e59a96e21 Message: select: support columns[LABEL].window.group_keys Modified files: lib/groonga/client/request/select.rb test/request/test-select.rb Modified: lib/groonga/client/request/select.rb (+11 -0) =================================================================== --- lib/groonga/client/request/select.rb 2017-02-03 17:25:59 +0900 (e316d8d) +++ lib/groonga/client/request/select.rb 2017-02-03 17:31:34 +0900 (5783529) @@ -257,6 +257,17 @@ module Groonga alias_method :sortby, :sort_keys alias_method :sort, :sort_keys + # Sets `columns[LABEL].window.group_keys` parameter. + # + # @return [Groonga::Client::Request::Select] The current + # request object. + # + # @since 0.4.1 + def group_keys(value) + add_parameter(OverwriteMerger, + ValuesParameter.new([:"#{prefix}group_keys"], value)) + end + private def prefix "columns[#{@label}].window." Modified: test/request/test-select.rb (+8 -0) =================================================================== --- test/request/test-select.rb 2017-02-03 17:25:59 +0900 (f3b3707) +++ test/request/test-select.rb 2017-02-03 17:31:34 +0900 (77801f2) @@ -248,6 +248,14 @@ class TestRequestSelect < Test::Unit::TestCase }, column.window.sort_keys("_id").to_parameters) end + + test "#group_keys" do + assert_equal({ + :table => "posts", + :"columns[label].window.group_keys" => "day, tag", + }, + column.window.group_keys(["day", "tag"]).to_parameters) + end end end -------------- next part -------------- HTML����������������������������...Download