Skip to content

Commit 5f7e25b

Browse files
Make a note about sqlx macros opt level (#1685)
* docs: Add a snippet about opt levels for `sqlx-macros` * docs: Fix does -> do
1 parent 313cc69 commit 5f7e25b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,16 @@ modifications (to the database-accessing parts of the code) are done, you can en
413413
to cache the results of the SQL query analysis using the `sqlx` command-line tool. See
414414
[sqlx-cli/README.md](./sqlx-cli/README.md#enable-building-in-offline-mode-with-query).
415415

416+
Compile time verified queries do quite a bit of work at compile time. Incremental actions like
417+
`cargo check` and `cargo build` can be significantly faster when using an optimized build by
418+
putting the following in your `Cargo.toml` (More information in the
419+
[Profiles section](https://doc.rust-lang.org/cargo/reference/profiles.html) of The Cargo Book)
420+
421+
```toml
422+
[profile.dev.package.sqlx-macros]
423+
opt-level = 3
424+
```
425+
416426
## Safety
417427

418428
This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% Safe Rust.

0 commit comments

Comments
 (0)