Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Clauses#union_all.

  • Loading branch information...
commit 6eb3a46c3cf6663d98c23dca7151adbfb60005d0 1 parent 2b536e5
@postmodern postmodern authored
Showing with 12 additions and 0 deletions.
  1. +9 −0 lib/ronin/sql/clauses.rb
  2. +3 −0  spec/sql/clauses_spec.rb
View
9 lib/ronin/sql/clauses.rb
@@ -171,6 +171,15 @@ def union(&block)
end
#
+ # Appends a `UNION ALL` clause.
+ #
+ # @return [self]
+ #
+ def union_all(&block)
+ clause([:UNION, :ALL],&block)
+ end
+
+ #
# Appends a `GROUP BY` clause.
#
# @param [Array<Field, Symbol>] columns
View
3  spec/sql/clauses_spec.rb
@@ -29,6 +29,9 @@
include_examples "Clause", :full_join, [:FULL, :JOIN], :table
include_examples "Clause", :on, :ON, proc { id == 1 }
include_examples "Clause", :union, :UNION, proc { select(:*).from(:table) }
+ include_examples "Clause", :union_all, [:UNION, :ALL], proc {
+ select(:*).from(:table)
+ }
include_examples "Clause", :group_by, [:GROUP, :BY], [:column1, :column2]
include_examples "Clause", :having, :HAVING, proc { max(priv) > 100 }
include_examples "Clause", :limit, :LIMIT, 100
Please sign in to comment.
Something went wrong with that request. Please try again.