discourse/migrations/lib/database/offline_connection.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
594 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Migrations::Database
class OfflineConnection
def initialize
@parametrized_insert_statements = []
end
def close
@parametrized_insert_statements = nil
end
def closed?
@parametrized_insert_statements.nil?
end
def insert(sql, parameters = [])
@parametrized_insert_statements << [sql, parameters]
end
def parametrized_insert_statements
@parametrized_insert_statements
end
def clear!
@parametrized_insert_statements.clear if @parametrized_insert_statements
end
end
end