From d2acc351a24f46a9f4a4df683d14ec8e7b696c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 28 Jul 2016 09:59:45 +0200 Subject: [PATCH 1/3] README.md: link to the new blog post --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e0765bd5b..e9e3a516b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ GRDB.swift [![Swift](https://img.shields.io/badge/swift-2.2-orange.svg?style=flat)](https://developer.apple.com/swift/) [![Platforms](https://img.shields.io/cocoapods/p/GRDB.swift.svg)](https://developer.apple.com/swift/) [![License](https://img.shields.io/github/license/groue/GRDB.swift.svg?maxAge=2592000)](/LICENSE) ========== -GRDB.swift is an SQLite toolkit for Swift 2.2. For Swift 3, see the [Swift3](https://github.com/groue/GRDB.swift/tree/Swift3) branch. +GRDB.swift is a Swift application toolkit that provides access to SQLite databases. + +It targets Swift 2.2, and Swift 3 in the [Swift3](https://github.com/groue/GRDB.swift/tree/Swift3) branch. It ships with a **low-level SQLite API**, and high-level tools that help dealing with databases: @@ -19,9 +21,9 @@ More than a set of tools that leverage SQLite abilities, GRDB is also: - **Safer**: read the blog post [Four different ways to handle SQLite concurrency](https://medium.com/@gwendal.roue/four-different-ways-to-handle-sqlite-concurrency-db3bcc74d00e) - **Faster**: see [Comparing the Performances of Swift SQLite libraries](https://github.com/groue/GRDB.swift/wiki/Performance) - Well documented & tested -- Suited for experienced SQLite users as well as beginners. -You should give it a try. +If you have experience with other database libraries, have a read at [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3): it will show how protocol-oriented programming helps you building robust applications. + --- From 21e419ff8a2fb60c7c0e4a71782cafe85e13424a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 28 Jul 2016 10:00:10 +0200 Subject: [PATCH 2/3] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9e3a516b..223b2aff4 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ More than a set of tools that leverage SQLite abilities, GRDB is also: - **Faster**: see [Comparing the Performances of Swift SQLite libraries](https://github.com/groue/GRDB.swift/wiki/Performance) - Well documented & tested -If you have experience with other database libraries, have a read at [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3): it will show how protocol-oriented programming helps you building robust applications. +If you have experience with other database libraries, have a look at [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3): it will show how protocol-oriented programming helps you building robust applications. --- From 0f987916b7fa722bff254b5bbf1825dc9519e9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 28 Jul 2016 17:03:37 +0200 Subject: [PATCH 3/3] Redirect Core Data and Realm users to "How to build an iOS application with SQLite and GRDB.swift" --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 223b2aff4..29cffee88 100644 --- a/README.md +++ b/README.md @@ -1555,10 +1555,19 @@ On top of the SQLite API described above, GRDB provides a toolkit for applicatio ## Records -**On top of the [SQLite API](#sqlite-api), GRDB provides protocols and a class** that help manipulating database rows as regular objects named "records". +**On top of the [SQLite API](#sqlite-api), GRDB provides protocols and a class** that help manipulating database rows as regular objects named "records": + +```swift +if let poi = PointOfInterest.fetchOne(db, key: 1) { + poi.isFavorite = true + try poi.update(db) +} +``` Your custom structs and classes can adopt each protocol individually, and opt in to focused sets of features. Or you can subclass the `Record` class, and get the full toolkit in one go: fetching methods, persistence methods, and changes tracking. +> :point_up: **Note**: if you are familiar with Core Data's NSManagedObject or Realm's Object, you may experience a cultural shock: GRDB records are not uniqued, and do not auto-update. This is both a purpose, and a consequence of protocol-oriented programming. You should read [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3) for a general introduction. + #### Inserting Records