Sha256: f710f8437cda12bd8c6b66445739883f56f9084f040fb9f93636900844006d1d

Contents?: true

Size: 484 Bytes

Versions: 6

Compression:

Stored size: 484 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)
        execute sql
        raw_connection.abandon_results!
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
database_flusher-0.3.4 lib/database_flusher/active_record/adapters/mysql2_adapter.rb
database_flusher-0.3.3 lib/database_flusher/active_record/adapters/mysql2_adapter.rb
database_flusher-0.3.2 lib/database_flusher/active_record/adapters/mysql2_adapter.rb
database_flusher-0.3.1 lib/database_flusher/active_record/adapters/mysql2_adapter.rb
database_flusher-0.3.0 lib/database_flusher/active_record/adapters/mysql2_adapter.rb
database_flusher-0.2.3 lib/database_flusher/active_record/adapters/mysql2_adapter.rb