Skip to content

Switch to sqlx for compile-time checked queries #874

Closed
@jyn514

Description

@jyn514

A common source of outages is an incorrect query with no tests (#862, #829, #648, etc). While it's good to have tests for all queries, it's not always feasible (especially until #822 is fixed). SQLx offers that advantage that it can check all queries at build time without having to write a test for that specific query. It is also fully async (cc @Kixiron), although that might mean we have to wait until we switch to tokio 0.2.

To avoid needless database connections, this should only connect to the database when a query is changed or added, or a schema change is made: launchbadge/sqlx#249. During CI it should always connect to the database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-technical-debtCategory: This makes the code harder to read and modify, but has no impact on end usersE-hardEffort: This will require a lot of workP-mediumMedium priorityS-waiting-on-asyncStatus: waiting on async migration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions