Skip to content

slqx::test doesn't take into account sqlite extensions #4372

Description

@robinvolf

I have found these related issues/pull requests

N/A

Description

First of, thank you for maintaining sqlx, it is a great library.

In version 0.9.0 this pr added support for sqlite extensions in query! macros and sqlx-cli. However sqlx::test still lacks this support. When you have an sqlite database, use extensions in migrations and then you write a test using sqlx::test, the test will fail due to migrations not being able to execute the functionality from extensions.

I would be happy to try to open a PR and fix this behavior, although I haven't really looked into the exact implementation. I think the ideal solution would be to modify sqlx::test in such a way that when working with an sqlite pool/connection to look into sqlx.toml and find out if there are any extensions, if yes, load them before running migrations. Do you think this is a good idea?

Reproduction steps

I have created a repository to reproduce this bug. It is a modification of the sqlite/extensions example.

SQLx version

0.9.0

Enabled SQLx features

"sqlite", "runtime-tokio", "sqlx-toml", "sqlite"

Database server and version

Sqlite 3.51.3

Operating system

Linux (NixOS)

Rust version

rustc 1.97.1 (8bab26f4f 2026-07-14)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions