Module: Veritas::SQL::Generator

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

Defined Under Namespace

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

Constant Summary collapse

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

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



52
53
54
# File 'lib/veritas/sql/generator.rb', line 52

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