-
Notifications
You must be signed in to change notification settings - Fork 69
Quick Tutorials
Song Zheng edited this page Jan 30, 2022
·
7 revisions
This page serves as a list of code samples to help you navigate certain concepts. When a pull request introduces a new concept, add it to this list!
- Mocking - sometimes you may not want libraries to be run during your tests. To auto mock out libraries, you just have to put the
module-name.js
into the__mocks__
folder. code sample for auto mocking.
- If you want to create, update, or destroy a table, here are the steps:
- Dump (backups):
pg_dump -h hostIP databaseName > ~/feb28-2022-c0d3_prod.sql
- Connect:
psql -U dbuser -h hostIP databaseName
Promise.all vs Includes -
When implementing session query
, we had to decide between:
- (40ms) using
Promise.all(....)
for 3 queries - (60ms) using 3 sequential queries
- (138ms) using 1 query
We all thought using 1 queries would be the fastest, so it turned out to be the slowest.