From 35ff37ed920d9c92eaecfb1b821a5b428e29d660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Tue, 27 Oct 2015 17:23:44 +0100 Subject: [PATCH] README.md --- README.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 86b15c492..cef6ea497 100644 --- a/README.md +++ b/README.md @@ -1216,7 +1216,6 @@ See also the [Record](#records) class, which builds on top of RowConvertible and - [Insert, Update and Delete](#insert-update-and-delete) - [Record Initializers](#record-initializers) - [Changes Tracking](#changes-tracking) -- [Record Errors](#record-errors) - [Advice](#advice) @@ -1484,7 +1483,9 @@ try dbQueue.inDatabase { db in - `insert`, `update`, `save` and `delete` can throw a [DatabaseError](#error-handling) whenever a SQLite integrity check fails. -- `update` and `reload` methods can also throw a [RecordError](#record-errors) of type RecordNotFound, whenever the record does not exist in the database. +- `update` and `reload` methods can also throw a RecordError of type RecordNotFound, whenever the record does not exist in the database. + + When saving a record that may, or may not, exist in the database, prefer the `save` method: it performs the necessary UPDATE or INSERT statement. - `delete` returns whether a row has been deleted from the database. @@ -1564,13 +1565,6 @@ Note that `databaseEdited` is based on value comparison: **setting a property to For an efficient algorithm which synchronizes the content of a database table with a JSON payload, check this [sample code](https://gist.github.com/groue/dcdd3784461747874f41). -### Record Errors - -Record methods can throw [DatabaseError](#error-handling) and also specific errors of type **RecordError**: - -- **RecordError.RecordNotFound**: thrown by `update` and `reload` when the primary key does not match any row in the database. - - ### Advice - [Autoincrement](#autoincrement)