From 4f5ff35dc4b36a57d972935fa0929444188da217 Mon Sep 17 00:00:00 2001 From: Fredrik Park Date: Tue, 1 Feb 2022 15:25:30 +0100 Subject: [PATCH] Document Offline mode with feature flags I ran into this and found the solution inside of this issue https://github.com/launchbadge/sqlx/issues/1593 Fixes #1593 --- sqlx-cli/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sqlx-cli/README.md b/sqlx-cli/README.md index 9fe4ca05be..2b62da4401 100644 --- a/sqlx-cli/README.md +++ b/sqlx-cli/README.md @@ -126,3 +126,13 @@ variable to `true`. If you want to make this the default, just add it to your `.env` file. `cargo sqlx prepare` will still do the right thing and connect to the database. + +#### Include queries behind feature flags (such as queryies inside of tests) + +In order for sqlx to be able to find queries behind certain feature flags you need to turn them +on by passing arguments to rustc. + +This is how you would turn all targets and features on. +```bash +cargo sqlx prepare -- --all-targets --all-features +```