Seeding 1 million test data in postgres using sequel
This is a note of things that I did for my testing setup.
While exploring postgres and testing few features I had to setup a database for it and seed with lot of data. Below are my notes while doing the same.
The aim is to create 1 million entries in postgres in ruby using sequel and faker gem. This post is very comprehensive and will be sharing the commands and steps which are self explanatory. Most of the database related task has been done using psql.
Creating the database and table
Generating the data using faker and sequel gems.
faker is a really good gem at generating data, it should suffice most of the use cases. Similarly I find sequel to be a really great gem, I am starting to use it more and more in personal projects. I like how minimal it is yet functional, reminds me of ecto library of elixir.
Updated on