Sha256: fb87db1a88daff48a6ce192667761099e584ada848789efe8efad0a381095420

Contents?: true

Size: 846 Bytes

Versions: 5

Compression:

Stored size: 846 Bytes

Contents

module Alf
  module Sql
    class Processor
      class FromSelf < Processor

        def on_with_exp(sexpr)
          q = builder.next_qualifier!
          name_intro = builder.name_intro(q, sexpr.select_exp)
          [ :with_exp,
            sexpr.with_spec.dup.push(name_intro),
            builder.select_all(sexpr.select_exp, q, q) ]
        end

        def on_nonjoin_exp(sexpr)
          q = builder.next_qualifier!
          [ :with_exp,
            [:with_spec,
              builder.name_intro(q, sexpr)],
            builder.select_all(sexpr, q, q) ]
        end
        alias :on_union      :on_nonjoin_exp
        alias :on_except     :on_nonjoin_exp
        alias :on_intersect  :on_nonjoin_exp
        alias :on_select_exp :on_nonjoin_exp

      end # class FromSelf
    end # class Processor
  end # module Sql
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-sql-0.16.3 lib/alf/sql/processor/from_self.rb
alf-sql-0.16.2 lib/alf/sql/processor/from_self.rb
alf-sql-0.16.1 lib/alf/sql/processor/from_self.rb
alf-sql-0.16.0 lib/alf/sql/processor/from_self.rb
alf-sql-0.15.0 lib/alf/sql/processor/from_self.rb