Skip to content

Instantly share code, notes, and snippets.

@schwern
Last active July 31, 2019 00:24
Show Gist options
  • Save schwern/803041e4e3ce6b9457cc1d17eb4dd902 to your computer and use it in GitHub Desktop.
Save schwern/803041e4e3ce6b9457cc1d17eb4dd902 to your computer and use it in GitHub Desktop.
require 'mysql2'
require 'faker'
# create table offset_test (
# id bigint primary key auto_increment,
# date datetime not null,
# index(date)
# )
con = Mysql2::Client.new(host: "localhost", database: "test")
st = con.prepare('insert into offset_test (date) values (?)')
1.upto(200000).each {
st.execute Faker::Time.backward(1000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment