Module: SQLTree

Defined in:
lib/sql_tree.rb

Overview

The SQLTree module is the basic namespace for the sql_tree gem.

It contains the shorthand parse method (i.e. SQLTree[sql_query]) and some helper methods that are used by the gem. It also requires the necessary files for the gem to function properly.

Defined Under Namespace

Modules: Node Classes: Parser, Token, Tokenizer

Constant Summary collapse

VERSION =
"0.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.identifier_quote_charObject

The character to quote variable names with.



12
13
14
# File 'lib/sql_tree.rb', line 12

def identifier_quote_char
  @identifier_quote_char
end

Class Method Details

.[](query, options = {}) ⇒ Object

The [] method is a shorthand for the SQLTree::Parser.parse method to parse an SQL query and return a SQL syntax tree.



20
21
22
# File 'lib/sql_tree.rb', line 20

def self.[](query, options = {})
  SQLTree::Parser.parse(query)
end