Skip to content

Instantly share code, notes, and snippets.

@david-pm
Created April 14, 2018 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-pm/60501a2353edd70bf5b040af9a024536 to your computer and use it in GitHub Desktop.
Save david-pm/60501a2353edd70bf5b040af9a024536 to your computer and use it in GitHub Desktop.
generate some mock data
--------r u b y
require 'csv'
require 'faker'
CSV.open("./users.csv", 'a+', write_headers: false) do |csv|
50_000.times do |n|
csv << [n, Faker::FunnyName.two_word_name, Faker::Internet.email, Faker::Address.city]
end
end
--------s q l
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(60),
email VARCHAR(120),
city VARCHAR(60)
);
COPY users (
id,
name,
email,
city
)
FROM './users.csv'
DELIMITER ',';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment