From 9934184f5fcb2e155cb1aaf497fa56310f80edd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 18 Jan 2017 08:51:48 +0100 Subject: [PATCH 1/9] README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 14a1481e8..d389517a3 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ Follow [@groue](http://twitter.com/groue) on Twitter for release announcements a GRDB.swift is a toolkit for SQLite databases with a focus on application development. -It provides raw access to SQLite and the SQL language, because one sometimes enjoys a sharp tool. It has efficient and robust concurrency primitives, because SQLite concurrency is not trivial. It provides persistence and fetching methods for your application models, because it is unlikely that dealing with raw database rows or writing SQL is your daily focus. +It provides raw access to SQLite and the SQL language, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, because it is unlikely that dealing with raw database rows or writing SQL is your daily focus. -Between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) that have application developers write a great deal of glue code, and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io) that don't take advantage of Swift, GRDB aims at providing a set of modern, to the point, APIs. +Between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) that have application developers write a great deal of glue code, and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io) that don't take advantage of Swift, GRDB aims at providing a set of modern and to the point APIs. -Since its introduction mid-2015, GRDB is now code, obviously, but also [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22). +Since its introduction mid-2015, GRDB has grown into a library that comes with [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22). --- From 52bcf97d73473972c644a37ec267c3f10dbab35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 18 Jan 2017 15:02:06 +0100 Subject: [PATCH 2/9] TODO.md --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index bdd76e6af..6dfcd87b1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,3 +1,4 @@ +- [ ] Drop DatabaseStore and support for FileProtectionKey if it can be confirmed that file inherit protection from their directory (see http://stackoverflow.com/questions/26033127/why-doesnt-nsfileprotectionkey-attribute-when-a-device-is-jailbroken) - [ ] Check for SQLCipher at runtime with `PRAGMA cipher_version`: https://discuss.zetetic.net/t/important-advisory-sqlcipher-with-xcode-8-and-new-sdks/1688 - [ ] We share the database cache between database pool writers and readers. But what if a writer modifies the database schema within a transaction, and a concurrent reader reads the cache? Bad things, isn't it? Write failing tests first, and fix the bug. - [ ] FetchedRecordsController is not reactive: From 29938f57038855ab62be277e049419788338c895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 18 Jan 2017 15:47:45 +0100 Subject: [PATCH 3/9] Documentation --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d389517a3..d07d85119 100644 --- a/README.md +++ b/README.md @@ -5360,7 +5360,8 @@ FAQ - [How do I close a database connection?](#how-do-i-close-a-database-connection) - [How do I open a database stored as a resource of my application?](#how-do-i-open-a-database-stored-as-a-resource-of-my-application) - [Generic parameter 'T' could not be inferred](#generic-parameter-t-could-not-be-inferred) -- [Compilation takes a long time](#compilation-takes-a-long-time) +- [Compilation takes a long time](#compilation-takes-a-long-time) +- [SQLite error 10 "disk I/O error", SQLite error 23 "not authorized"](#sqlite-error-10-disk-i-o-error-sqlite-error-23-not-authorized) ### How do I close a database connection? @@ -5477,6 +5478,11 @@ var persistentDictionary: [String: DatabaseValueConvertible?] { > ``` +### SQLite error 10 "disk I/O error", SQLite error 23 "not authorized" + +Those errors may be the sign that SQLite can't access the database due to [data protection](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforImplementingYourApp/StrategiesforImplementingYourApp.html#//apple_ref/doc/uid/TP40007072-CH5-SW21). When your application should be able to run in the background on a locked device, it should be able to handle this error. This error can also be prevented altogether by using a more relaxed [file protection](https://developer.apple.com/reference/foundation/filemanager/1653059-file_protection_values). + + Sample Code =========== From eed21b8f8f8af1461014f4325613d392cf32ef41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 18 Jan 2017 15:48:24 +0100 Subject: [PATCH 4/9] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d07d85119..c1524111a 100644 --- a/README.md +++ b/README.md @@ -5361,7 +5361,7 @@ FAQ - [How do I open a database stored as a resource of my application?](#how-do-i-open-a-database-stored-as-a-resource-of-my-application) - [Generic parameter 'T' could not be inferred](#generic-parameter-t-could-not-be-inferred) - [Compilation takes a long time](#compilation-takes-a-long-time) -- [SQLite error 10 "disk I/O error", SQLite error 23 "not authorized"](#sqlite-error-10-disk-i-o-error-sqlite-error-23-not-authorized) +- [SQLite error 10 "disk I/O error", SQLite error 23 "not authorized"](#sqlite-error-10-disk-io-error-sqlite-error-23-not-authorized) ### How do I close a database connection? From ee798df57d827dfb942c52fea26ef3405382aa7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 18 Jan 2017 15:54:13 +0100 Subject: [PATCH 5/9] Documentation --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c1524111a..a6eef7222 100644 --- a/README.md +++ b/README.md @@ -5480,7 +5480,11 @@ var persistentDictionary: [String: DatabaseValueConvertible?] { ### SQLite error 10 "disk I/O error", SQLite error 23 "not authorized" -Those errors may be the sign that SQLite can't access the database due to [data protection](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforImplementingYourApp/StrategiesforImplementingYourApp.html#//apple_ref/doc/uid/TP40007072-CH5-SW21). When your application should be able to run in the background on a locked device, it should be able to handle this error. This error can also be prevented altogether by using a more relaxed [file protection](https://developer.apple.com/reference/foundation/filemanager/1653059-file_protection_values). +Those errors may be the sign that SQLite can't access the database due to [data protection](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforImplementingYourApp/StrategiesforImplementingYourApp.html#//apple_ref/doc/uid/TP40007072-CH5-SW21). + +When your application should be able to run in the background on a locked device, it has to catch this error, and, for example, wait for [UIApplicationDelegate.applicationProtectedDataDidBecomeAvailable(_:)](https://developer.apple.com/reference/uikit/uiapplicationdelegate/1623044-applicationprotecteddatadidbecom) or [UIApplicationProtectedDataDidBecomeAvailable](https://developer.apple.com/reference/uikit/uiapplicationprotecteddatadidbecomeavailable) notification and retry the failed database operation. + +This error can also be prevented altogether by using a more relaxed [file protection](https://developer.apple.com/reference/foundation/filemanager/1653059-file_protection_values). Sample Code From dad48df0399bdce2d430db08f6f5406d8fa9672f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 18 Jan 2017 16:05:49 +0100 Subject: [PATCH 6/9] TODO --- TODO.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO.md b/TODO.md index 6dfcd87b1..9550f0cfd 100644 --- a/TODO.md +++ b/TODO.md @@ -114,3 +114,5 @@ Reading list: - FetchedRecordsController: https://github.com/jflinter/Dwifft - FetchedRecordsController: https://github.com/wokalski/Diff.swift (Faster) - FetchedRecordsController: https://github.com/andre-alves/PHDiff +- React oddities: + - http://stackoverflow.com/questions/41721769/realm-update-object-without-updating-lists From 2a515b1d8d2d352869facd1ac1867b3264c55ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 19 Jan 2017 07:55:20 +0100 Subject: [PATCH 7/9] README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6eef7222..53173be8a 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ GRDB.swift is a toolkit for SQLite databases with a focus on application develop It provides raw access to SQLite and the SQL language, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, because it is unlikely that dealing with raw database rows or writing SQL is your daily focus. -Between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) that have application developers write a great deal of glue code, and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io) that don't take advantage of Swift, GRDB aims at providing a set of modern and to the point APIs. +Sitting between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io), GRDB aims at providing a set of to the point APIs that answer the needs of applications. -Since its introduction mid-2015, GRDB has grown into a library that comes with [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22). +The library comes with [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22). --- From 052ad87da0fc4b6ce64b6691f02a7fde81334257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 19 Jan 2017 07:56:02 +0100 Subject: [PATCH 8/9] README --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 53173be8a..6b05f4336 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,7 @@ GRDB.swift is a toolkit for SQLite databases with a focus on application develop It provides raw access to SQLite and the SQL language, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, because it is unlikely that dealing with raw database rows or writing SQL is your daily focus. -Sitting between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io), GRDB aims at providing a set of to the point APIs that answer the needs of applications. - -The library comes with [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22). +Sitting between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io), GRDB aims at providing a set of to the point APIs that answer the needs of applications. It comes with [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22). --- From 54d8a03e87e165ba29414efc03b6d38cbc55d978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 19 Jan 2017 08:56:34 +0100 Subject: [PATCH 9/9] README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b05f4336..e78a2cbc3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Follow [@groue](http://twitter.com/groue) on Twitter for release announcements a GRDB.swift is a toolkit for SQLite databases with a focus on application development. -It provides raw access to SQLite and the SQL language, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, because it is unlikely that dealing with raw database rows or writing SQL is your daily focus. +It provides raw access to SQLite and the SQL language, because one sometimes enjoys a sharp tool. It has robust concurrency primitives, so that multi-threaded applications can efficiently use their databases. It grants your application models with persistence and fetching methods, so that you don't have to deal with raw database rows or write SQL. Sitting between libraries like [SQLite.swift](http://github.com/stephencelis/SQLite.swift) or [FMDB](http://github.com/ccgus/fmdb) and frameworks like [Core Data](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreData/) or [Realm](http://realm.io), GRDB aims at providing a set of to the point APIs that answer the needs of applications. It comes with [reference documentation](http://cocoadocs.org/docsets/GRDB.swift/0.100.0/index.html), [guidelines](#documentation), [general articles](https://medium.com/@gwendal.roue), [sample code](#sample-code), and a lot of interesting resolved issues that may answer your eventual [questions](https://github.com/groue/GRDB.swift/issues?utf8=✓&q=is%3Aissue%20label%3Aquestion) and foster [best practices](https://github.com/groue/GRDB.swift/issues?q=is%3Aissue+label%3A%22best+practices%22).