diff --git a/CHANGELOG.md b/CHANGELOG.md index f0320b985..e06ba468a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Release Notes ============= +## Next Release + +**Fixed** + +- Restore support for SQLite [pre-update hooks](https://github.com/groue/GRDB.swift#support-for-sqlite-pre-update-hooks) + +**New** + +- Upgrade custom SQLite builds to [v3.14.1](http://www.sqlite.org/changes.html). + + ## 0.82.1 Released September 14, 2016 diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index cbc4a5317..69a22a648 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -2017,7 +2017,7 @@ private struct CopiedDatabaseEventImpl : DatabaseEventImpl { return impl.copy(self) } - private init(kind: Kind, initialRowID: Int64?, finalRowID: Int64?, impl: DatabasePreUpdateEventImpl) { + fileprivate init(kind: Kind, initialRowID: Int64?, finalRowID: Int64?, impl: DatabasePreUpdateEventImpl) { self.kind = kind self.initialRowID = (kind == .update || kind == .delete ) ? initialRowID : nil self.finalRowID = (kind == .update || kind == .insert ) ? finalRowID : nil @@ -2061,11 +2061,11 @@ private struct CopiedDatabaseEventImpl : DatabaseEventImpl { /// nor does it request other data via the sqlite3_preupdate_* APIs /// until asked. private struct MetalDatabasePreUpdateEventImpl : DatabasePreUpdateEventImpl { - private let connection: SQLiteConnection - private let kind: DatabasePreUpdateEvent.Kind + let connection: SQLiteConnection + let kind: DatabasePreUpdateEvent.Kind - private let databaseNameCString: UnsafePointer? - private let tableNameCString: UnsafePointer? + let databaseNameCString: UnsafePointer? + let tableNameCString: UnsafePointer? var databaseName: String { return String(cString: databaseNameCString!) } var tableName: String { return String(cString: tableNameCString!) } @@ -2128,7 +2128,7 @@ private struct CopiedDatabaseEventImpl : DatabaseEventImpl { private func getValue(_ connection: SQLiteConnection, column: CInt, sqlite_func: (_ connection: SQLiteConnection, _ column: CInt, _ value: inout SQLiteValue? ) -> CInt ) -> DatabaseValue? { var value : SQLiteValue? = nil - guard sqlite_func(connection: connection, column: column, value: &value) == SQLITE_OK else { return nil } + guard sqlite_func(connection, column, &value) == SQLITE_OK else { return nil } if let value = value { return DatabaseValue(sqliteValue: value) } @@ -2152,17 +2152,17 @@ private struct CopiedDatabaseEventImpl : DatabaseEventImpl { /// Impl for DatabasePreUpdateEvent that contains copies of all event data. private struct CopiedDatabasePreUpdateEventImpl : DatabasePreUpdateEventImpl { - private let databaseName: String - private let tableName: String - private let columnsCount: CInt - private let depth: CInt - private let initialDatabaseValues: [DatabaseValue]? - private let finalDatabaseValues: [DatabaseValue]? + let databaseName: String + let tableName: String + let columnsCount: CInt + let depth: CInt + let initialDatabaseValues: [DatabaseValue]? + let finalDatabaseValues: [DatabaseValue]? - private func initialDatabaseValue(atIndex index: Int) -> DatabaseValue? { return initialDatabaseValues?[index] } - private func finalDatabaseValue(atIndex index: Int) -> DatabaseValue? { return finalDatabaseValues?[index] } + func initialDatabaseValue(atIndex index: Int) -> DatabaseValue? { return initialDatabaseValues?[index] } + func finalDatabaseValue(atIndex index: Int) -> DatabaseValue? { return finalDatabaseValues?[index] } - private func copy(_ event: DatabasePreUpdateEvent) -> DatabasePreUpdateEvent { + func copy(_ event: DatabasePreUpdateEvent) -> DatabasePreUpdateEvent { return event } } diff --git a/SQLiteCustom/src b/SQLiteCustom/src index 891853fe5..6d39b62d1 160000 --- a/SQLiteCustom/src +++ b/SQLiteCustom/src @@ -1 +1 @@ -Subproject commit 891853fe56a3bcbdaf9a42dfd64f4ff4a8613ca2 +Subproject commit 6d39b62d11fbfe45c4b4249c76092d8e94f9fea8 diff --git a/TODO.md b/TODO.md index 6d745c021..a45e54875 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ - [ ] Remove DatabaseWriter.writeForIssue117 when https://bugs.swift.org/browse/SR-2623 is fixed (remove `writeForIssue117`, use `write` instead, and build in Release configuration) - [ ] Restore SQLCipher -- [ ] Restore custom builds (and update swiftlyfalling/SQLiteLib) - [ ] Restore dispatching tests in GRDBOSXTests (they are disabled in order to avoid linker errors) - DatabasePoolReleaseMemoryTests - DatabasePoolSchemaCacheTests diff --git a/Tests/Public/Core/DatabasePool/DatabasePoolBackupTests.swift b/Tests/Public/Core/DatabasePool/DatabasePoolBackupTests.swift index 06b320daf..801bdb08a 100644 --- a/Tests/Public/Core/DatabasePool/DatabasePoolBackupTests.swift +++ b/Tests/Public/Core/DatabasePool/DatabasePoolBackupTests.swift @@ -38,6 +38,7 @@ class DatabasePoolBackupTests: GRDBTestCase { } } + @available(OSX 10.10, *) func testConcurrentWriteDuringBackup() { assertNoError { let source = try makeDatabasePool(filename: "source.sqlite") diff --git a/Tests/Public/SQLTableBuilder/SQLTableBuilderTests.swift b/Tests/Public/SQLTableBuilder/SQLTableBuilderTests.swift index 778a26ad2..e92fa69ef 100644 --- a/Tests/Public/SQLTableBuilder/SQLTableBuilderTests.swift +++ b/Tests/Public/SQLTableBuilder/SQLTableBuilderTests.swift @@ -32,7 +32,7 @@ class SQLTableBuilderTests: GRDBTestCase { assertNoError { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in - if #available(iOS 8.2, *) { + if #available(iOS 8.2, OSX 10.10, *) { try db.create(table: "test", temporary: true, ifNotExists: true, withoutRowID: true) { t in t.column("id", .integer).primaryKey() }