Skip to content

Commit

Permalink
docs: removes dotenvy from README.md
Browse files Browse the repository at this point in the history
- removes additional reference in macros documentation
- updates url footnotes to dotenvy for consistency
  • Loading branch information
ethan-sargent committed Apr 3, 2024
1 parent 20bd63a commit 8e99a97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ Differences from `query()`:
queries against; the database does not have to contain any data but must be the same
kind (MySQL, Postgres, etc.) and have the same schema as the database you will be connecting to at runtime.

For convenience, you can use [a `.env` file][dotenv] to set DATABASE_URL so that you don't have to pass it every time:
For convenience, you can use [a `.env` file][dotenvy] to set DATABASE_URL so that you don't have to pass it every time:

```
DATABASE_URL=mysql://localhost/my_database
```

[dotenv]: https://github.com/allan2/dotenvy#Usage
[dotenvy]: https://github.com/allan2/dotenvy#Usage

The biggest downside to `query!()` is that the output type cannot be named (due to Rust not
officially supporting anonymous records). To address that, there is a `query_as!()` macro that is
Expand Down
8 changes: 2 additions & 6 deletions src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/// ## Requirements
/// * The `DATABASE_URL` environment variable must be set at build-time to point to a database
/// server with the schema that the query string will be checked against. All variants of `query!()`
/// use [dotenv]<sup>1</sup> so this can be in a `.env` file instead.
/// use [dotenvy] so this can be in a `.env` file instead.
///
/// * Or, `.sqlx` must exist at the workspace root. See [Offline Mode](#offline-mode-requires-the-offline-feature)
/// below.
Expand All @@ -69,11 +69,7 @@
/// * The schema of the database URL (e.g. `postgres://` or `mysql://`) will be used to
/// determine the database type.
///
/// <sup>1</sup> The `dotenv` crate itself appears abandoned as of [December 2021](https://github.com/dotenv-rs/dotenv/issues/74)
/// so we now use the [dotenvy] crate instead. The file format is the same.
///
/// [dotenv]: https://crates.io/crates/dotenv
/// [dotenvy]: https://crates.io/crates/dotenvy
/// [dotenvy]: https://github.com/allan2/dotenvy
/// ## Query Arguments
/// Like `println!()` and the other formatting macros, you can add bind parameters to your SQL
/// and this macro will typecheck passed arguments and error on missing ones:
Expand Down

0 comments on commit 8e99a97

Please sign in to comment.