Module: Axiom::SQL::Generator

Defined in:
lib/axiom/sql/generator.rb,
lib/axiom/sql/generator/literal.rb,
lib/axiom/sql/generator/version.rb,
lib/axiom/sql/generator/visitor.rb,
lib/axiom/sql/generator/function.rb,
lib/axiom/sql/generator/relation.rb,
lib/axiom/sql/generator/attribute.rb,
lib/axiom/sql/generator/direction.rb,
lib/axiom/sql/generator/identifier.rb,
lib/axiom/sql/generator/relation/set.rb,
lib/axiom/sql/generator/relation/base.rb,
lib/axiom/sql/generator/relation/unary.rb,
lib/axiom/sql/generator/function/string.rb,
lib/axiom/sql/generator/relation/binary.rb,
lib/axiom/sql/generator/function/numeric.rb,
lib/axiom/sql/generator/function/aggregate.rb,
lib/axiom/sql/generator/function/predicate.rb,
lib/axiom/sql/generator/relation/insertion.rb,
lib/axiom/sql/generator/function/connective.rb,
lib/axiom/sql/generator/function/proposition.rb,
lib/axiom/sql/generator/relation/materialized.rb

Defined Under Namespace

Modules: Attribute, Direction, Function, Identifier, Literal Classes: InvalidRelationError, Relation, Visitor

Constant Summary collapse

LEFT_PARENTHESIS =
'('.freeze
RIGHT_PARENTHESIS =
')'.freeze
VERSION =

Gem version

'0.2.0'.freeze

Class Method Summary collapse

Class Method Details

.parenthesize!(sql) ⇒ #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 a parenthesized SQL statement (inline modification)

Parameters:

  • sql (#to_s)

Returns:

  • (#to_s)

    same instance as sql


55
56
57
# File 'lib/axiom/sql/generator.rb', line 55

def self.parenthesize!(sql)
  sql.insert(0, LEFT_PARENTHESIS) << RIGHT_PARENTHESIS
end