Class: Rooq::DSL::SetOperation
- Inherits:
-
Object
- Object
- Rooq::DSL::SetOperation
- Defined in:
- lib/rooq/dsl/select_query.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
readonly
Returns the value of attribute all.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #except(other, all: false) ⇒ Object
-
#initialize(operator, left, right, all: false) ⇒ SetOperation
constructor
A new instance of SetOperation.
- #intersect(other, all: false) ⇒ Object
- #order_by(*specs) ⇒ Object
- #to_sql(dialect = Rooq::Dialect::PostgreSQL.new) ⇒ Object
-
#union(other, all: false) ⇒ Object
Allow chaining.
Constructor Details
#initialize(operator, left, right, all: false) ⇒ SetOperation
Returns a new instance of SetOperation.
219 220 221 222 223 224 225 |
# File 'lib/rooq/dsl/select_query.rb', line 219 def initialize(operator, left, right, all: false) @operator = operator @left = left @right = right @all = all freeze end |
Instance Attribute Details
#all ⇒ Object (readonly)
Returns the value of attribute all.
217 218 219 |
# File 'lib/rooq/dsl/select_query.rb', line 217 def all @all end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
217 218 219 |
# File 'lib/rooq/dsl/select_query.rb', line 217 def left @left end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
217 218 219 |
# File 'lib/rooq/dsl/select_query.rb', line 217 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
217 218 219 |
# File 'lib/rooq/dsl/select_query.rb', line 217 def right @right end |
Instance Method Details
#except(other, all: false) ⇒ Object
240 241 242 |
# File 'lib/rooq/dsl/select_query.rb', line 240 def except(other, all: false) SetOperation.new(:except, self, other, all: all) end |
#intersect(other, all: false) ⇒ Object
236 237 238 |
# File 'lib/rooq/dsl/select_query.rb', line 236 def intersect(other, all: false) SetOperation.new(:intersect, self, other, all: all) end |
#order_by(*specs) ⇒ Object
244 245 246 |
# File 'lib/rooq/dsl/select_query.rb', line 244 def order_by(*specs) OrderedSetOperation.new(self, specs.flatten) end |
#to_sql(dialect = Rooq::Dialect::PostgreSQL.new) ⇒ Object
227 228 229 |
# File 'lib/rooq/dsl/select_query.rb', line 227 def to_sql(dialect = Rooq::Dialect::PostgreSQL.new) dialect.render_set_operation(self) end |
#union(other, all: false) ⇒ Object
Allow chaining
232 233 234 |
# File 'lib/rooq/dsl/select_query.rb', line 232 def union(other, all: false) SetOperation.new(:union, self, other, all: all) end |