Class: ConceptQL::Operators::Except

Inherits:
BinaryOperatorOperator show all
Defined in:
lib/conceptql/operators/except.rb

Constant Summary

Constants inherited from Operator

Operator::COLUMNS

Instance Attribute Summary

Attributes inherited from Operator

#arguments, #options, #upstreams, #values

Instance Method Summary collapse

Methods inherited from BinaryOperatorOperator

#display_name, #graph_it, #upstreams

Methods inherited from Operator

#columns, #evaluate, #initialize, #label, #select_it, #set_values, #sql, #stream, #types

Methods included from Metadatable

#allows_many_upstreams, #allows_one_upstream, #argument, #category, #desc, #humanized_class_name, #inherited, #just_class_name, #option, #predominant_types, #preferred_name, #reset_categories, #to_metadata, #types

Constructor Details

This class inherits a constructor from ConceptQL::Operators::Operator

Instance Method Details

#query(db) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/conceptql/operators/except.rb', line 9

def query(db)
  if ignore_dates?
    query = db.from(Sequel.as(left.evaluate(db), :l))
      .left_join(Sequel.as(right.evaluate(db), :r), l__criterion_id: :r__criterion_id, l__criterion_type: :r__criterion_type)
      .where(r__criterion_id: nil)
      .select_all(:l)
    db.from(query)
  else
    left.evaluate(db).except(right.evaluate(db))
  end
end