Point out that the database attribute must be imported.

Fixes #1074.
This commit is contained in:
Jeb Rosen 2019-08-22 10:18:44 -07:00
parent 14ee05b9a1
commit d98e938e1a
1 changed files with 3 additions and 0 deletions

View File

@ -239,6 +239,9 @@ In your application's source code, create a unit-like struct with one internal
type. This type should be the type listed in the "`Poolable` Type" column. Then type. This type should be the type listed in the "`Poolable` Type" column. Then
decorate the type with the `#[database]` attribute, providing the name of the decorate the type with the `#[database]` attribute, providing the name of the
database that you configured in the previous step as the only parameter. database that you configured in the previous step as the only parameter.
You will need to either add `#[macro_use] extern crate rocket_contrib` to the
crate root or have a `use rocket_contrib::database` in scope, otherwise the
`database` attribute will not be available.
Finally, attach the fairing returned by `YourType::fairing()`, which was Finally, attach the fairing returned by `YourType::fairing()`, which was
generated by the `#[database]` attribute: generated by the `#[database]` attribute: