Skip to content

Instantly share code, notes, and snippets.

@mzibari
Created July 22, 2020 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzibari/1a2f121f7c21203cd7ea24a1342078f9 to your computer and use it in GitHub Desktop.
Save mzibari/1a2f121f7c21203cd7ea24a1342078f9 to your computer and use it in GitHub Desktop.
How are the syntaxes async and await useful when writing JavaScript code?
It allows for the use of try catch in an asynchronous code
With respect to Knex, how does the transaction method relate to BEGIN and COMMIT syntax in PostgreSQL?
The concept behind the two is the same, a pending transaction that has to be commited. If there is a connection failure, the database will rollback any queries executed on that connection to the pre-transaction state.
What is a "sequence table" in PostgreSQL?
It's a special table created by typing CREATE SEQUENCE name;
It's a umber generator, you can use nextval, currval, and setval to operate on the sequence.
What does RESTART IDENTITY CASCADE do?
Restart the identity squence and deleted all referenced rows
What does SELECT setval('blogful_users_id_seq', 1) do?
Update the sequence value after selecting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment