mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
Merge branch 'master' of github.com:groue/GRDB.swift into BackgroundFetchedRecordsController
This commit is contained in:
commit
899b9b07dd
2 files changed
+16
-5
No files matched your search
@@ -17,11 +17,9 @@ 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, so that you don't have to deal with raw database rows or write SQL.
|
||||
|
||||
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.
|
||||
|
||||
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).
|
||||
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).
|
||||
|
||||
|
||||
---
|
||||
@@ -5360,7 +5358,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-io-error-sqlite-error-23-not-authorized)
|
||||
|
||||
|
||||
### How do I close a database connection?
|
||||
@@ -5477,6 +5476,15 @@ 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 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
|
||||
===========
|
||||
|
||||
|
||||
@@ -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:
|
||||
@@ -113,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
|
||||
Reference in new issue
Block a user