Skip to content

Commit

Permalink
Make a note about sqlx macros opt level (#1685)
Browse files Browse the repository at this point in the history
* docs: Add a snippet about opt levels for `sqlx-macros`

* docs: Fix does -> do
  • Loading branch information
CosmicHorrorDev authored Feb 16, 2022
1 parent 313cc69 commit 5f7e25b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5f7e25b

Please sign in to comment.