Thursday, 1 August 2019

SQL stored procedure vs. . . this thing I'd like you to see.

I'm implementing an API using Node, Express, and Postgresql. I have a route that causes my application to query the users table for various things (e.g., return a single user by ID, return all users, delete a user, update a user, create a user, etc.). I'm using `node-postgres` as the client for connecting the database to my Node app. With this tool, each time you query the database, you represent that query using a string that looks like this:export const getAllUsersQuery = `SELECTid,firstName,lastName,email,birthdayFROM users;`;This is probably a goofy question, but how does this differ from a stored procedure?

Submitted August 01, 2019 at 08:10PM by IanAbsentia

No comments:

Post a Comment