Class: OracleSqlParser::Ast::QueryBlock

Inherits:
Hash
  • Object
show all
Defined in:
lib/oracle-sql-parser/ast/query_block.rb

Instance Method Summary collapse

Methods inherited from Hash

[], #initialize, #inspect, #method_missing, #remove_nil_values!

Methods inherited from Base

#==, [], #ast, find_different_value, #initialize, #inspect, #remove_nil_values!

Constructor Details

This class inherits a constructor from OracleSqlParser::Ast::Hash

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OracleSqlParser::Ast::Hash

Instance Method Details

#to_sqlObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/oracle-sql-parser/ast/query_block.rb', line 3

def to_sql
  [
    "select",
    @ast[:hint],
    @ast[:modifier],
    @ast[:select_list],
    "from",
    @ast[:select_sources],
    @ast[:where_clause],
    @ast[:group_by_clause],
    @ast[:model_clause]
  ].compact.map(&:to_sql).join(" ")
end