Feature/seeders

in utopian-io •  7 years ago  (edited)

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hey @deviad I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

Great addition for the devs, do try to elaborate a little more on your posts in the future.

Please mention the PR number/link next time.

You can contact us on Discord.
[utopian-moderator]

Congratulations @deviad! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!