Skip to content

Store queries in files instead of writing them inline #67

Open
@bartlomieju

Description

@bartlomieju

Some of the queries in api/src/db/database.rs are very large which makes them hard to read.

We should use sqlx::query_file! macro and move large queries to separate files in api/src/db/queries/.

One drawback is that we will need to specify them as sqlx::query_file!("api/src/db/queries/<query_name>.sql") which will not make them clickable, but it's probably still better.

Once we do that, we should set up SQL formatting as well (eg. https://github.com/dprint/dprint-plugin-sql).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions