Module: Axiom::SQL::Generator::Function::Connective

Includes:
Axiom::SQL::Generator::Function
Included in:
Relation::Unary
Defined in:
lib/axiom/sql/generator/function/connective.rb

Overview

Generates an SQL statement for a connective

Constant Summary collapse

AND =
'AND'.freeze
OR =
'OR'.freeze
NOT =
'NOT'.freeze

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

Instance Method Summary collapse

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

Instance Method Details

#visit_axiom_function_connective_conjunction(conjunction) ⇒ #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.

Visit an Conjunction connective

Parameters:

  • conjunction (Function::Connective::Conjunction)

Returns:

  • (#to_s)


23
24
25
# File 'lib/axiom/sql/generator/function/connective.rb', line 23

def visit_axiom_function_connective_conjunction(conjunction)
  Generator.parenthesize!(binary_infix_operation_sql(AND, conjunction))
end

#visit_axiom_function_connective_disjunction(disjunction) ⇒ #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.

Visit an Disjunction connective

Parameters:

  • disjunction (Function::Connective::Disjunction)

Returns:

  • (#to_s)


34
35
36
# File 'lib/axiom/sql/generator/function/connective.rb', line 34

def visit_axiom_function_connective_disjunction(disjunction)
  Generator.parenthesize!(binary_infix_operation_sql(OR, disjunction))
end

#visit_axiom_function_connective_negation(negation) ⇒ #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.

Visit an Negation connective

Parameters:

  • negation (Function::Connective::Negation)

Returns:

  • (#to_s)


45
46
47
# File 'lib/axiom/sql/generator/function/connective.rb', line 45

def visit_axiom_function_connective_negation(negation)
  unary_prefix_operation_sql(NOT, negation)
end