From d98e938e1a6f94732ac5c587afee4ffc59a2cfc1 Mon Sep 17 00:00:00 2001 From: Jeb Rosen Date: Thu, 22 Aug 2019 10:18:44 -0700 Subject: [PATCH] Point out that the database attribute must be imported. Fixes #1074. --- site/guide/6-state.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/site/guide/6-state.md b/site/guide/6-state.md index 44c7facc..30638f15 100644 --- a/site/guide/6-state.md +++ b/site/guide/6-state.md @@ -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: