Skip to content

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

@Aypak

Description

@Aypak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions