Feature/seeders

New Features

  • I have added the possibility to populate the database tables with dummy data in order to bring on our developing activities more easily.

Developers can execute the script by running dist/utils/seeders.js which will automatically populate the tables with the desired amount of rows.
In the next release I am going to implement other relations than posts and users. Also I want to give the possibility to choose interactively the number of columns and which tables to populate without editing the script by hand.

It will help to avoid situations where you must wait for someone else to give you an updated database populated with some data.
At the same time this will allow to test the performance of the queries that we create when we have thousands of rows, testing therefore the scalability of our code.

https://github.com/utopian-io/api.utopian.io/blob/develop/src/utils/seeders.ts#L1

Run your server as usual
Screen Shot 2018-02-06 at 10.29.54 PM.png

Then run node ./dist/utils/seeders.js from within the root of your project folder.

Screen Shot 2018-02-06 at 10.30.51 PM.png



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center