Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (14 sloc) 508 Bytes
require 'bundler/setup'
require 'active_record'
require_relative 'support/benchmark_rails'
db_setup script: "bm_create_string_columns_setup.rb"
ActiveRecord::Base.establish_connection(ENV.fetch('DATABASE_URL'))
ActiveRecord::Migration.verbose = false
class User < ActiveRecord::Base; end
attributes = {}
STRING_COLUMNS_COUNT.times do |i|
attributes[:"column#{i}"] = "Some string #{i}"
end
Benchmark.rails("activerecord/#{db_adapter}_create_string_columns", time: 5) do
User.create!(attributes)
end