- How are the syntaxes async and await useful when writing JavaScript code?
The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains.
- With respect to Knex, how does the transaction method relate to BEGIN and COMMIT syntax in PostgreSQL?
Knex transaction() method wraps a sql statement and is equivalent to wrapping a sql statement in BEGIN and COMMIT.
- What is a "sequence table" in PostgreSQL?
A sequence table is a sequence number generator that can be applied to other tables. You can set a min and max value like 100 and 1000 and specify where to start incrementing.
https://www.postgresql.org/docs/9.5/sql-createsequence.html
CREATE [ TEMPORARY | TEMP ] SEQUENCE [ IF NOT EXISTS ] name [ INCREMENT [ BY ] increment ]
[ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ]
[ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]
[ OWNED BY { table_name.column_name | NONE } ]
- What does RESTART IDENTITY CASCADE do?
https://dba.stackexchange.com/questions/193495/postgresql-truncate-a-table-on-cascade-and-reset-all-hierarchic-sequences-with
The TRUNCATE statement has an additional option RESTART IDENTITY which resets the sequences associated with the table columns.
- What does SELECT setval('blogful_users_id_seq', 1) do?
https://www.postgresql.org/docs/8.2/functions-sequence.html
Sets the sequence table start value to a given integer.