Sha256: 495f593b2f9ac7bc9997e909e0ce01aff68adc4391e08487f0e252a7767599ee
Contents?: true
Size: 626 Bytes
Versions: 66
Compression:
Stored size: 626 Bytes
Contents
module Bmg module Sql class Processor class Flatten < Processor def on_with_exp(sexpr) @subqueries = sexpr.with_spec.to_hash apply(sexpr.select_exp) end attr_reader :subqueries alias :on_select_exp :copy_and_apply alias :on_missing :copy_and_apply def on_table_as(sexpr) return sexpr unless subqueries return sexpr unless subquery = subqueries[sexpr.table_name] [ :subquery_as, apply(subquery), sexpr.right ] end end # class Flatten end # class Processor end # module Sql end # module Bmg
Version data entries
66 entries across 66 versions & 1 rubygems