README: note req. of `DATABASE_URL` for `query!()`
@@ -126,6 +126,13 @@ let countries = sqlx::query!(
.await?;
```
+For this mode, the `DATABASE_URL` environment variable must be set at build time so that the macro can utilize the database
+server to analyze queries and check them for correctness and record their inputs (bind parameters) and outputs (columns); the database does not have to contain any data but must have the same schema as the database you will be connecting to at runtime. For convenience, you can use [a `.env` file](https://github.com/dotenv-rs/dotenv#examples) to set `DATABASE_URL` so that you don't have to pass it every time:
+
+```
+DATABASE_URL=mysql://localhost/my_database
+```
+
See the beginnings of a [RealWorld](https://github.com/gothinkster/realworld/tree/master/api#users-for-authentication) implementation in [examples/realworld-postgres](./examples/realworld-postgres).
## Safety
