Skip to content

Test sqlx offline files #4054

@w1ll-i-code

Description

@w1ll-i-code

I have found these related issues/pull requests

None found

Description

The problem I have is the following: I want to have the cached data for local and CI builds, such that they do not need to have access to the database. However, when I change the database schema, I don't want to forget to update the files if there was a breaking change. So I want to re-run the cached files and make sure that the database still returns the same data.

The alternatives would otherwise be:

  1. Needing a database access for e.g. the unit tests
  2. Recompiling / rechecking the whole application for the check
  3. Copying the target directory from the build environment to the test environment

Prefered solution

I would like to have a sub-command in sqlx e.g. sqlx verify, that takes all the cached files .sqlx/*.json, re-runs the query and if the result miss-matches, throws an error.

Is this a breaking change? Why or why not?

This is not a breaking change.

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