Sha256: 71f172a6887eae9a57dc9f26dbc697a1ad269cfe43bf12d5932dd60c39bcffd1

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

module Arel
  module Visitors
    class Informix < Arel::Visitors::ToSql
      private
      def visit_Arel_Nodes_SelectStatement o, collector
        collector << "SELECT "
        collector = maybe_visit o.offset, collector
        collector = maybe_visit o.limit, collector
        collector = o.cores.inject(collector) { |c,x|
          visit_Arel_Nodes_SelectCore x, c
        }
        if o.orders.any?
          collector << "ORDER BY "
          collector = inject_join o.orders, collector, ", "
        end
        collector = maybe_visit o.lock, collector
      end
      def visit_Arel_Nodes_SelectCore o, collector
        collector = inject_join o.projections, collector, ", "
        froms = false
        if o.source && !o.source.empty?
          froms = true
          collector << " FROM "
          collector = visit o.source, collector
        end

        if o.wheres.any?
          collector << " WHERE "
          collector = inject_join o.wheres, collector, " AND "
        end

        if o.groups.any?
          collector << "GROUP BY "
          collector = inject_join o.groups, collector, ", "
        end

        maybe_visit o.having, collector
      end
      def visit_Arel_Nodes_Offset o, collector
        collector << "SKIP "
        visit o.expr, collector
      end
      def visit_Arel_Nodes_Limit o, collector
        collector << "FIRST "
        visit o.expr, collector
        collector << " "
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 7 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/arel-6.0.4/lib/arel/visitors/informix.rb
arel-6.0.4 lib/arel/visitors/informix.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/arel-6.0.3/lib/arel/visitors/informix.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/visitors/informix.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/visitors/informix.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-6.0.3/lib/arel/visitors/informix.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/arel-6.0.3/lib/arel/visitors/informix.rb
arel-6.0.3 lib/arel/visitors/informix.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/arel-6.0.0/lib/arel/visitors/informix.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/arel-6.0.0/lib/arel/visitors/informix.rb
arel-6.0.2 lib/arel/visitors/informix.rb
arel-6.0.1 lib/arel/visitors/informix.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/arel-6.0.0/lib/arel/visitors/informix.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/arel-6.0.0/lib/arel/visitors/informix.rb
arel-6.0.0 lib/arel/visitors/informix.rb
arel-6.0.0.beta2 lib/arel/visitors/informix.rb