mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
fix(prepare): store temporary query files inside the workspace
This commit is contained in:
committed by
Austin Bonander
parent
70934d7cd2
commit
cf3ce13d27
8
FAQ.md
8
FAQ.md
@@ -200,11 +200,17 @@ as an ergonomic choice it does _not_ block committing if `cargo sqlx prepare` fa
|
||||
|
||||
We're working on a way for the macros to save their data to the filesystem automatically which should be part of SQLx 0.7,
|
||||
so your pre-commit hook would then just need to stage the changed files. This can be enabled by creating a directory
|
||||
and setting the `SQLX_OFFLINE_DIR` environment variable to it before compiling, e.g.
|
||||
and setting the `SQLX_OFFLINE_DIR` environment variable to it before compiling.
|
||||
Additionally, if you're not using Cargo or have a nonstandard setup, you may want to set the `SQLX_TMP`
|
||||
variable in order to store temporary query files somewhere that isn't picked up by git.
|
||||
These files should get cleaned up automatically, but they may not if there's a failure. For example:
|
||||
|
||||
```shell
|
||||
$ mkdir .sqlx
|
||||
$ export SQLX_OFFLINE_DIR="./.sqlx"`
|
||||
$ # Optional and only useful if using a nonstandard setup, ensures temp files won't get picked up by git on failure
|
||||
$ mkdir ./my-custom-target/sqlx
|
||||
$ export SQLX_TMP="./my-custom-target/sqlx-tmp"
|
||||
$ cargo check
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user