Conection Nodejs with Postgresql
- Necesary
Download or Clone repositorie, in terminal:
npm i express pg nodemon
PSQL
- init PSQL with password: password
GET BOOKS
- In folder src/index.js, activate function getBooks();
TERMINAL
- In terminal:
npm run dev
INSERT USER
- In folder src/index.js, comment function -> //getBooks();
TERMINAL
- In terminal:
npm run dev
PSQL
- In PSQL, connect to library:
\c library
- List of Tables:
\dt
LIBRARY
- library=# select * from users;
DELETE USER
- Delete user, comment -> //instertUser();
TERMINAL
- In terminal:
npm run dev
PSQL
- in PSQL, select * from users;
EDIT USER
- editUser(), comment -> //deleteUser();
TERMINAL
- In terminal:
npm run dev
PSQL
- in PSQL, select * from users;