Class: Veritas::SQL::Generator::Relation::Binary

Inherits:
Veritas::SQL::Generator::Relation show all
Defined in:
lib/veritas/sql/generator/relation/binary.rb

Overview

Generates an SQL statement for a Binary relation

Direct Known Subclasses

Set

Defined Under Namespace

Classes: Base

Constant Summary collapse

JOIN =
'NATURAL JOIN'.freeze
PRODUCT =
'CROSS JOIN'.freeze
LEFT_NAME =
'left'.freeze
RIGHT_NAME =
'right'.freeze

Constants inherited from Veritas::SQL::Generator::Relation

EMPTY_HASH, EMPTY_STRING, SEPARATOR, STAR

Constants included from Identifier

Identifier::ESCAPED_QUOTE, Identifier::QUOTE

Constants inherited from Visitor

Visitor::DOUBLE_COLON, Visitor::NAME_REP, Visitor::NAME_SEP_REGEXP, Visitor::UNDERSCORE

Instance Attribute Summary

Attributes inherited from Veritas::SQL::Generator::Relation

#name

Instance Method Summary collapse

Methods inherited from Veritas::SQL::Generator::Relation

#initialize, #to_s, #to_sql, #to_subquery, visit, #visit, #visited?

Methods included from Identifier

#visit_identifier

Methods included from Attribute

#visit_veritas_attribute

Methods inherited from Visitor

handler_for, #visit, #visited?

Constructor Details

This class inherits a constructor from Veritas::SQL::Generator::Relation

Instance Method Details

#visit_veritas_algebra_join(join) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Visit an Join

Parameters:

  • join (Algebra::Join)

Returns:

  • (self)


23
24
25
26
27
28
29
30
# File 'lib/veritas/sql/generator/relation/binary.rb', line 23

def visit_veritas_algebra_join(join)
  @header = join.header
  set_operation(JOIN)
  set_columns(join)
  set_operands(join)
  set_name
  self
end

#visit_veritas_algebra_product(product) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Visit an Product

Parameters:

  • product (Algebra::Product)

Returns:

  • (self)


39
40
41
42
43
44
45
46
# File 'lib/veritas/sql/generator/relation/binary.rb', line 39

def visit_veritas_algebra_product(product)
  @header = product.header
  set_operation(PRODUCT)
  set_columns(product)
  set_operands(product)
  set_name
  self
end