Created
April 14, 2018 04:09
-
-
Save david-pm/60501a2353edd70bf5b040af9a024536 to your computer and use it in GitHub Desktop.
generate some mock data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------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