- Explain what Knex.js is.
- Explain why Knex.js is useful.
- Use Knex.js to operate on PostgreSQL tables.
Turn to your neighbor and explain what Knex.js is in your own words. Be prepared to share with the class.
Turn to your neighbor and explain why Knex.js is useful in your own words. How does it help prevent against potential malicious attacks?
clone the lesson repo:
git clone https://github.com/Shurlow/knex-lesson.git
install dependencies:
npm i
Start with a clean movies database:
dropdb movie_junkies_dev
createdb movie_junkies_dev
curl -fsSL https://git.io/voXVD | psql movie_junkies_dev
- Hook up
knexfile.jsto the database and require at the top ofindex.js - Complete the functions in
index.js(Note: each function is immediately invoked in a commend bellow it. Uncomment any function call that you want to test out)