mirror of https://github.com/rwf2/Rocket.git
parent
14ee05b9a1
commit
d98e938e1a
|
@ -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
|
||||
decorate the type with the `#[database]` attribute, providing the name of the
|
||||
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
|
||||
generated by the `#[database]` attribute:
|
||||
|
||||
|
|
Loading…
Reference in New Issue