Skip to content

Commit

Permalink
fix(readme): link to dotenv crate
Browse files Browse the repository at this point in the history
closes #1405
  • Loading branch information
abonander committed Nov 10, 2021
1 parent ce801b9 commit 51954fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,14 @@ 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 to set DATABASE_URL so that you don't have to pass it every time:
For convenience, you can use [a `.env` file][dotenv] 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/dotenv-rs/dotenv#examples

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
mostly identical except that you can name the output type.
Expand Down

0 comments on commit 51954fe

Please sign in to comment.