Make a note about sqlx macros opt level (#1685)

* docs: Add a snippet about opt levels for `sqlx-macros`

* docs: Fix does -> do
This commit is contained in:
LovecraftianHorror 2022-02-15 22:14:41 -06:00 committed by GitHub
parent 313cc69988
commit 5f7e25b81d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -413,6 +413,16 @@ modifications (to the database-accessing parts of the code) are done, you can en
to cache the results of the SQL query analysis using the `sqlx` command-line tool. See
[sqlx-cli/README.md](./sqlx-cli/README.md#enable-building-in-offline-mode-with-query).
Compile time verified queries do quite a bit of work at compile time. Incremental actions like
`cargo check` and `cargo build` can be significantly faster when using an optimized build by
putting the following in your `Cargo.toml` (More information in the
[Profiles section](https://doc.rust-lang.org/cargo/reference/profiles.html) of The Cargo Book)
```toml
[profile.dev.package.sqlx-macros]
opt-level = 3
```
## Safety
This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% Safe Rust.