Sha256: 846d2d8ac18c0a35a412f3798c81cb3c6f813fdd1a75e8ceeb11932b27a14514

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true
module DatabaseFlusher
  module ActiveRecord
    class Mysql2Adapter < AbstractAdapter
      def initialize(connection)
        super
        flags = raw_connection.query_options[:flags]
        unless flags.include?('MULTI_STATEMENTS'.freeze)
          raise 'MULTI_STATEMENTS flag is not enabled'
        end
      end

      private

      def execute_multi(sql)
        _result = raw_connection.query sql
        while raw_connection.next_result
          # just to make sure that all queries are finished
          _result = raw_connection.store_result
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
database_flusher-0.2.2 lib/database_flusher/active_record/adapters/mysql2_adapter.rb