class DbSubsetter::Dialect::Generic

Dialect to subset to/from database without explicit support

Constants

INSERT_BATCH_SIZE

Public Class Methods

import() { || ... } click to toggle source
# File lib/db_subsetter/dialect/generic.rb, line 7
def self.import
  ActiveRecord::Base.connection.disable_referential_integrity do
    yield
  end
end
integrity_problems() click to toggle source
# File lib/db_subsetter/dialect/generic.rb, line 13
def self.integrity_problems
  raise NotImplementedError, 'integrity_problems not implemented for this dialect'
end
truncate_table(table) click to toggle source
# File lib/db_subsetter/dialect/generic.rb, line 17
def self.truncate_table(table)
  ActiveRecord::Base.connection.truncate(table)
rescue NotImplementedError
  table = ActiveRecord::Base.connection.quote_table_name(table)
  ActiveRecord::Base.connection.execute("DELETE FROM #{table}")
end