From d1e7af866d49e6a6f03853685e445efa38dab210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 30 Sep 2015 22:22:27 +0200 Subject: [PATCH] README.md --- README.md | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3943178c5..d0d26a6bd 100644 --- a/README.md +++ b/README.md @@ -238,8 +238,8 @@ The last two methods are the only ones that don't take a custom SQL query as an - [Fetching Rows](#fetching-rows) - [Column Values](#column-values) - [Rows as Dictionaries](#rows-as-dictionaries) -- [RowConvertible Protocol](#rowconvertible-protocol) - [Convenience Rows](#convenience-rows) +- [RowConvertible Protocol](#rowconvertible-protocol) #### Fetching Rows @@ -371,6 +371,13 @@ row.toDictionary() // NSDictionary ``` +#### Convenience Rows + +Rows is a fundamental type in GRDB, used by many other APIs. + +From time to time, you'll want to build a custom one from scratch: use `Row(dictionary:)`. + + #### RowConvertible Protocol You may use the `RowConvertible` protocol, which **grants fetching methods to any type** that can be initialized from a database row: @@ -401,18 +408,6 @@ PointOfInterest.fetchOne(db, "SELECT ...") // PointOfInterest? See also the [Record](#records) class, which builds on top of RowConvertible and adds a few extra features like CRUD operations, and changes tracking. -#### Convenience Rows - -Rows is a fundamental type in GRDB, used by many other APIs. - -From time to time, you'll want to build a custom one from scratch: use `Row(dictionary:)`. - -```swift -let row = Row(dictionary: ["title": "Rome", "latitude": 41.8919, "longitude": 12.5113]) -let poi = PointOfInterest(row: row) -``` - - ### Value Queries Instead of rows, you can directly fetch **values**. Like rows, fetch them as **sequences**, **arrays**, or **single** values: