Class: Axiom::SQL::Generator::Relation::Binary

Inherits:
Axiom::SQL::Generator::Relation show all
Defined in:
lib/axiom/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 Axiom::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 Axiom::SQL::Generator::Relation

#name

Instance Method Summary collapse

Methods inherited from Axiom::SQL::Generator::Relation

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

Methods included from Identifier

#visit_identifier

Methods included from Attribute

#visit_axiom_attribute

Methods inherited from Visitor

handler_for, #visit, #visited?

Constructor Details

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

Instance Method Details

#visit_axiom_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



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

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

#visit_axiom_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



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

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