Sha256: f06307163066bc8d9ae1d43df3a1c2736768e9d9cb44d3dd5a67565527bca73e

Contents?: true

Size: 734 Bytes

Versions: 93

Compression:

Stored size: 734 Bytes

Contents

require 'helper'

module Arel
  module Visitors
    describe 'the ibm_db visitor' do
      before do
        @visitor = IBM_DB.new Table.engine.connection
      end

      it 'uses FETCH FIRST n ROWS to limit results' do
        stmt = Nodes::SelectStatement.new
        stmt.limit = Nodes::Limit.new(1)
        sql = @visitor.accept(stmt)
        sql.must_be_like "SELECT FETCH FIRST 1 ROWS ONLY"
      end

      it 'uses FETCH FIRST n ROWS in updates with a limit' do
        stmt = Nodes::UpdateStatement.new
        stmt.limit = Nodes::Limit.new(1)
        stmt.key = 'id'
        sql = @visitor.accept(stmt)
        sql.must_be_like "UPDATE NULL WHERE 'id' IN (SELECT 'id' FETCH FIRST 1 ROWS ONLY)"
      end

    end
  end
end

Version data entries

93 entries across 75 versions & 14 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/test/visitors/test_ibm_db.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/test/visitors/test_ibm_db.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/arel-5.0.1.20140414130214/test/visitors/test_ibm_db.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/visitors/test_ibm_db.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/arel-3.0.2/test/visitors/test_ibm_db.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/arel-3.0.3/test/visitors/test_ibm_db.rb
arel-5.0.1.20140414130214 test/visitors/test_ibm_db.rb
arel-4.0.2 test/visitors/test_ibm_db.rb
arel-5.0.0 test/visitors/test_ibm_db.rb
arel-3.0.3 test/visitors/test_ibm_db.rb
arel-4.0.1 test/visitors/test_ibm_db.rb
challah-1.0.0 vendor/bundle/gems/arel-4.0.0/test/visitors/test_ibm_db.rb
swipe-rails-0.0.5 vendor/bundle/gems/arel-3.0.2/test/visitors/test_ibm_db.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/arel-3.0.2/test/visitors/test_ibm_db.rb