From 18126454217f2d8159491af8e2e372e4044115c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sun, 21 Jun 2026 18:40:48 +0200 Subject: [PATCH] Mention in docs that many `#[sqlx::test]`s can slow down rebuild time --- src/macros/test.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/macros/test.md b/src/macros/test.md index ec3cee90b0..524edd5e54 100644 --- a/src/macros/test.md +++ b/src/macros/test.md @@ -173,6 +173,8 @@ async fn basic_test(pool: PgPool) -> sqlx::Result<()> { # } ``` +Note that if you have a large number of tests and migrations, embedding the migrations next to each `#[sqlx::test]` can significantly slow down compilation times. In that case consider storing the migrations into a shared variable in your crate and then reference that variable using `migrator = ` in each test. + ### Automatic Fixture Application (requires `migrate` feature) Since tests are isolated from each other but may require data to already exist in the database to keep from growing