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

Inherits:
Axiom::SQL::Generator::Relation::Base show all
Defined in:
lib/axiom/sql/generator/relation/binary.rb

Overview

Generates an SQL statement for base relation binary operands

Constant Summary

Constants inherited from Unary

Unary::ANY_ROWS, Unary::COLLAPSIBLE, Unary::DISTINCT, Unary::NO_ROWS

Constants included from Direction

Direction::DESC

Constants included from Identifier

Identifier::ESCAPED_QUOTE, Identifier::QUOTE

Constants included from Literal

Literal::ESCAPED_QUOTE, Literal::FALSE, Literal::NULL, Literal::QUOTE, Literal::SEPARATOR, Literal::TIME_SCALE, Literal::TRUE

Constants included from Function::Aggregate

Function::Aggregate::COUNT, Function::Aggregate::MAXIMUM, Function::Aggregate::MEAN, Function::Aggregate::MINIMUM, Function::Aggregate::STANDARD_DEVIATION, Function::Aggregate::SUM, Function::Aggregate::VARIANCE

Constants included from Function::Connective

Function::Connective::AND, Function::Connective::NOT, Function::Connective::OR

Constants included from Function::Predicate

Function::Predicate::BETWEEN, Function::Predicate::EMPTY_ARRAY, Function::Predicate::EQUAL_TO, Function::Predicate::EQUAL_TO_NULL, Function::Predicate::GREATER_THAN, Function::Predicate::GREATER_THAN_OR_EQUAL_TO, Function::Predicate::IN, Function::Predicate::LESS_THAN, Function::Predicate::LESS_THAN_OR_EQUAL_TO, Function::Predicate::NOT_BETWEEN, Function::Predicate::NOT_EQUAL_TO, Function::Predicate::NOT_EQUAL_TO_NULL, Function::Predicate::NOT_IN

Constants included from Function::String

Function::String::LENGTH

Constants included from Function::Numeric

Function::Numeric::ABSOLUTE, Function::Numeric::ADD, Function::Numeric::DIVIDE, Function::Numeric::MOD, Function::Numeric::MULTIPLY, Function::Numeric::POWER, Function::Numeric::SQUARE_ROOT, Function::Numeric::SUBTRACT

Constants inherited from Axiom::SQL::Generator::Relation

EMPTY_HASH, EMPTY_STRING, SEPARATOR, STAR

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 Unary

#initialize, #visit_axiom_algebra_extension, #visit_axiom_algebra_projection, #visit_axiom_algebra_rename, #visit_axiom_algebra_restriction, #visit_axiom_algebra_summarization, #visit_axiom_relation_base, #visit_axiom_relation_operation_limit, #visit_axiom_relation_operation_offset, #visit_axiom_relation_operation_order

Methods included from Direction

#visit_axiom_relation_operation_order_ascending, #visit_axiom_relation_operation_order_descending

Methods included from Attribute

#visit_axiom_attribute

Methods included from Identifier

#visit_identifier

Methods included from Literal

dup_frozen, #visit_class, #visit_date, #visit_date_time, #visit_enumerable, #visit_false_class, #visit_nil_class, #visit_numeric, #visit_string, #visit_time, #visit_true_class

Methods included from Function::Aggregate

#visit_axiom_aggregate_count, #visit_axiom_aggregate_maximum, #visit_axiom_aggregate_mean, #visit_axiom_aggregate_minimum, #visit_axiom_aggregate_standard_deviation, #visit_axiom_aggregate_sum, #visit_axiom_aggregate_variance

Methods included from Function::Connective

#visit_axiom_function_connective_conjunction, #visit_axiom_function_connective_disjunction, #visit_axiom_function_connective_negation

Methods included from Function::Predicate

#visit_axiom_function_predicate_equality, #visit_axiom_function_predicate_exclusion, #visit_axiom_function_predicate_greater_than, #visit_axiom_function_predicate_greater_than_or_equal_to, #visit_axiom_function_predicate_inclusion, #visit_axiom_function_predicate_inequality, #visit_axiom_function_predicate_less_than, #visit_axiom_function_predicate_less_than_or_equal_to

Methods included from Function::Proposition

#visit_axiom_function_proposition_contradiction, #visit_axiom_function_proposition_tautology

Methods included from Function::String

#visit_axiom_function_string_length

Methods included from Function::Numeric

#visit_axiom_function_numeric_absolute, #visit_axiom_function_numeric_addition, #visit_axiom_function_numeric_division, #visit_axiom_function_numeric_exponentiation, #visit_axiom_function_numeric_modulo, #visit_axiom_function_numeric_multiplication, #visit_axiom_function_numeric_square_root, #visit_axiom_function_numeric_subtraction, #visit_axiom_function_numeric_unary_minus, #visit_axiom_function_numeric_unary_plus

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

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

Methods inherited from Visitor

handler_for, #visit, #visited?

Constructor Details

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

Instance Method Details

#to_subquery#to_s

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.

Return the SQL suitable for an subquery

Does not parenthesize the query

Returns:



115
116
117
118
# File 'lib/axiom/sql/generator/relation/binary.rb', line 115

def to_subquery
  return EMPTY_STRING unless visited?
  generate_sql
end