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

Use query builder to replace explicit SQL queries in API #16

Open
Aypak opened this issue Nov 15, 2021 · 0 comments
Open

Use query builder to replace explicit SQL queries in API #16

Aypak opened this issue Nov 15, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Aypak
Copy link
Contributor

Aypak commented Nov 15, 2021

Problem description

In all the API endpoints involving database operations, explicit SQL queries are used. This can be problematic to maintain and refactor e.g insert statements., and can also be vulnerable to injection attacks.

Suggested solution

A query builder may be a more efficient solution for database operations in the API. It is more flexible than an ORM which may be opinionated. Knex is our query builder of choice. It is reliable, well-maintained, and has good documentation.

Requirements

Refactor all of the API endpoints that use explicit SQL queries to use Knex query builder. These include:

Ensure that the library is imported correctly, and is included in the application dependencies

@Aypak Aypak added the good first issue Good for newcomers label Nov 15, 2021
@Aypak Aypak added enhancement New feature or request and removed good first issue Good for newcomers labels Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant