Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite SQL queries to conform to best practices #2

Open
niharikasingh opened this issue Sep 4, 2018 · 0 comments
Open

Rewrite SQL queries to conform to best practices #2

niharikasingh opened this issue Sep 4, 2018 · 0 comments
Labels
good first issue Good for newcomers

Comments

@niharikasingh
Copy link
Owner

Right now, the SQL queries for many files in the server/ folder use util.format to construct the query, e.g.,

else queryString += util.format(" professor LIKE '%%%s%%' AND course LIKE '%%%s%%'", professor, course);

These queries need to be re-written to conform to best practices provided here https://node-postgres.com/features/queries#parameterized-query, e.g.,

var queryString = "SELECT doctype, hearts, docname, semester, year, grade, professorlast, random, $1=ANY(userhearts) AS thisuserheart";

@niharikasingh niharikasingh added the good first issue Good for newcomers label Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant