diff --git a/3.0/docs/fluent/getting-started.md b/3.0/docs/fluent/getting-started.md index ee3567e5..a2535437 100644 --- a/3.0/docs/fluent/getting-started.md +++ b/3.0/docs/fluent/getting-started.md @@ -79,10 +79,14 @@ final class User: <#Database#>Model { self.age = age } } + +extension User: Content { } ``` The example above shows a simple model representing a user. You can make both structs and classes a model. You can even conform types that come from external modules. The only requirement is that these types conform to `Codable`, which must be declared on the base type for synthesized (automatic) conformance. +*Note:* `Content` conformance will ensure that the object can be encoded and decoded from HTTP messages. This will be necessary when performing a query. + Take a look at [Fluent → Model](models.md) for more information on creating models with custom ID types and keys. ## Configuring the Database @@ -165,8 +169,6 @@ Server starting on http://localhost:8080 ## Performing a Query -Now that you have created a model and a corresponding schema in your database, let's make your first query. - ```swift router.get("users") { req in return User.query(on: req).all()