Merge branch 'master' into Swift3bis

This commit is contained in:
Gwendal Roué committed 2016-07-19 08:20:22 +02:00
commit b3c12c33b7
6 files changed
+43 -22

No files matched your search

+9
View File
@@ -1,6 +1,15 @@
Release Notes
=============
## 0.75.2
Released July 18, 2016
**Fixed**
- Fixed crashes that could happen when using virtual tables (fixes [#82](https://github.com/groue/GRDB.swift/issues/82))
## 0.75.1
Released July 8, 2016
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
s.version = '0.75.1'
s.version = '0.75.2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A versatile SQLite toolkit for Swift, with WAL mode support.'
s.homepage = 'https://github.com/groue/GRDB.swift'
+23 -12
View File
@@ -1097,17 +1097,7 @@ final class StatementCompilationObserver {
observer.databaseEventKinds.append(.delete(tableName: String(cString: CString1!)))
case SQLITE_UPDATE:
let observer = unsafeBitCast(observerPointer, to: StatementCompilationObserver.self)
let tableName = String(cString: CString1!)
// Ignore all changes to sqlite_master.
//
// The schema changes are already processed by the SQLITE_DROP_TABLE, SQLITE_CREATE_INDEX, etc. (see above).
//
// Plus SQLite will sometimes announce that SELECT statements
// perform changes to sqlite_master. See DatabasePoolConcurrencyTests.testIssue80()
if tableName != "sqlite_master" {
observer.insertUpdateEventKind(tableName: tableName, columnName: String(cString: CString2!))
}
observer.insertUpdateEventKind(tableName: String(cString: CString1!), columnName: String(cString: CString2!))
case SQLITE_SAVEPOINT:
let observer = unsafeBitCast(observerPointer, to: StatementCompilationObserver.self)
let name = String(cString: CString2!)
@@ -1408,7 +1398,28 @@ extension Database {
static func preconditionValidSelectStatement(sql: String, observer: StatementCompilationObserver) {
GRDBPrecondition(observer.invalidatesDatabaseSchemaCache == false, "Invalid statement type for query \(String(reflecting: sql)): use UpdateStatement instead.")
GRDBPrecondition(observer.savepointAction == nil, "Invalid statement type for query \(String(reflecting: sql)): use UpdateStatement instead.")
GRDBPrecondition(observer.databaseEventKinds.isEmpty, "Invalid statement type for query \(String(reflecting: sql)): use UpdateStatement instead.")
// Don't check for observer.databaseEventKinds.isEmpty
//
// When observer.databaseEventKinds.isEmpty is NOT empty, this means
// that the database is changed by the statement.
//
// It thus looks like the statement should be performed by an
// UpdateStatement, not a SelectStatement: transaction observers are not
// notified of database changes when they are executed by
// a SelectStatement.
//
// However https://github.com/groue/GRDB.swift/issues/80 and
// https://github.com/groue/GRDB.swift/issues/82 have shown that SELECT
// statements on virtual tables can generate database changes.
//
// :-(
//
// OK, this is getting very difficult to protect the user against
// himself: just give up, and allow SelectStatement to execute database
// changes. We'll cope with eventual troubles later, when they occur.
//
// GRDBPrecondition(observer.databaseEventKinds.isEmpty, "Invalid statement type for query \(String(reflecting: sql)): use UpdateStatement instead.")
}
func updateStatementWillExecute(_ statement: UpdateStatement) {
+8 -8
View File
@@ -25,7 +25,7 @@ You should give it a try.
---
The Swift3 branch has no version. It is currently synced with v0.75.1 of the Swift 2.2 [main branch](https://github.com/groue/GRDB.swift).
The Swift3 branch has no version. It is currently synced with v0.75.2 of the Swift 2.2 [main branch](https://github.com/groue/GRDB.swift).
Follow [@groue](http://twitter.com/groue) on Twitter for release announcements and usage tips.
@@ -280,7 +280,7 @@ let dbQueue = try DatabaseQueue(
configuration: config)
```
See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Structs/Configuration.html) for more details.
See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Structs/Configuration.html) for more details.
## Database Pools
@@ -360,7 +360,7 @@ let dbPool = try DatabasePool(
configuration: config)
```
See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Structs/Configuration.html) for more details.
See [Configuration](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Structs/Configuration.html) for more details.
Database pools are more memory-hungry than database queues. See [Memory Management](#memory-management) for more information.
@@ -1442,10 +1442,10 @@ for person in Person.fetch(db, sql, adapter: adapter) {
For more information about row adapters, see the documentation of:
- [RowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Protocols/RowAdapter.html): the protocol that lets you define your custom row adapters
- [ColumnMapping](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Structs/ColumnMapping.html): a row adapter that renames row columns
- [SuffixRowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Structs/SuffixRowAdapter.html): a row adapter that hides the first columns of a row
- [ScopeAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Structs/ScopeAdapter.html): the row adapter that groups several adapters together to define scopes
- [RowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Protocols/RowAdapter.html): the protocol that lets you define your custom row adapters
- [ColumnMapping](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Structs/ColumnMapping.html): a row adapter that renames row columns
- [SuffixRowAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Structs/SuffixRowAdapter.html): a row adapter that hides the first columns of a row
- [ScopeAdapter](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Structs/ScopeAdapter.html): the row adapter that groups several adapters together to define scopes
## Raw SQLite Pointers
@@ -3340,7 +3340,7 @@ let count2 = dbQueue.inDatabase { db in
SQLite concurrency is a wiiide topic.
First have a detailed look at the full API of [DatabaseQueue](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Classes/DatabaseQueue.html) and [DatabasePool](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Classes/DatabasePool.html). Both adopt the [DatabaseReader](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Protocols/DatabaseReader.html) and [DatabaseWriter](http://cocoadocs.org/docsets/GRDB.swift/0.75.1/Protocols/DatabaseWriter.html) protocols, so that you can write code that targets both classes.
First have a detailed look at the full API of [DatabaseQueue](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Classes/DatabaseQueue.html) and [DatabasePool](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Classes/DatabasePool.html). Both adopt the [DatabaseReader](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Protocols/DatabaseReader.html) and [DatabaseWriter](http://cocoadocs.org/docsets/GRDB.swift/0.75.2/Protocols/DatabaseWriter.html) protocols, so that you can write code that targets both classes.
If the built-in queues and pools do not fit your needs, or if you can not guarantee that a single queue or pool is accessing your database file, you may have a look at:
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.75.1</string>
<string>0.75.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+1
View File
@@ -22,6 +22,7 @@
Not sure
- [ ] Issue 85: Consider Django ordering: "Each order_by() call will clear any previous ordering": https://docs.djangoproject.com/en/1.9/ref/models/querysets/#order-by
- [ ] Support for NSColor/UIColor. Beware UIColor components can go beyond [0, 1.0] in iOS10.