Name: Johnny Nguyen StudentID: 101185885
Node.js application which makes use of the node-postgres package to interact with a PostGres database and perform CRUD operations. Additionally uses node:readline module to maintain user input loop.
- Install dependencies using npm:
npm install
- Run application
node student-app.js
CRUD operations
- getAllStudents() - Function that performs a query to fetch and returns all records within the student table (Read)
- addStudent(first_name,last_name,email,enrollment_date) - Function that performs query to insert record for new student (Write)
- updateStudentEmail(student_id,new_email) - Function that performs a query to update email for speicifc record by student_id (Update)
- deleteStudent(student_id) - Function that performs a query to delete student record by id (Delete)
A demonstation of the application can be found here.