From 07dbee52cdf51235ff03ba8ee983e765bd30456d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 17 Sep 2016 05:58:50 +0200 Subject: [PATCH] Documentation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3f023766a..8f4e4db8d 100644 --- a/README.md +++ b/README.md @@ -707,10 +707,10 @@ Generally speaking, you can extract the type you need, *provided it can be conve - **Invalid conversions throw a fatal error.** ```swift - let row = Row.fetchOne(db, "SELECT 'foo'")! - row.value(atIndex: 0) as String // "foo" - row.value(atIndex: 0) as Date? // fatal error: could not convert "foo" to Date. - row.value(atIndex: 0) as Date // fatal error: could not convert "foo" to Date. + let row = Row.fetchOne(db, "SELECT 'Mom’s birthday'")! + row.value(atIndex: 0) as String // "Mom’s birthday" + row.value(atIndex: 0) as Date? // fatal error: could not convert "Mom’s birthday" to Date. + row.value(atIndex: 0) as Date // fatal error: could not convert "Mom’s birthday" to Date. ``` This fatal error can be avoided with the [DatabaseValueConvertible.fromDatabaseValue()](#custom-value-types) method.