SHARE
TWEET

Untitled

a guest Sep 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How are the syntaxes async and await useful when writing JavaScript code?
  2. /src/things/things-router.js, line 37
  3. - it extrapolates the promise from inside the .all() in the chains for each route, but it is still a promise type function which includes catch() and next() allowing the promises to continue in sequence
  4.  
  5. With respect to Knex, how does the transaction method relate to BEGIN and COMMIT syntax in PostgreSQL?
  6. seed.thingful_tables.sql, beginning and end
  7. - BEGIN creates a transaction block, and the statements in the block are all executed in a single transaction. COMMIT marks the end of the transaction block.
  8.  
  9. What is a "sequence table" in PostgreSQL?
  10. - It is table data created in sequence due to the relationships between datasets
  11. - thingful_reviews exists in sequence with thingful_things because it relies on both the thing_id and the user_id
  12. - thingful_things exists in sequence with thingful_users because it relies on the user_id
  13.  
  14. What does RESTART IDENTITY CASCADE do?
  15. seed.thingful_tables.sql, line 7
  16. - used when truncating a table (cascade, so removing all items related to an id attached to the truncated items) and restarting identities from all truncated items. So, when more items are added, the ids in the table are reset to begin at 1 again (i think)
  17.  
  18. What does SELECT setval('blogful_users_id_seq', 1) do?
  19. - updates the value of the object in the sequence 'blogful_users_id_seq' to 1, so that the subsequent values will follow (nextval is 2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top