From 34f3097616fe460ed24049b8a460de71c086594c Mon Sep 17 00:00:00 2001 From: Sebastian Nicklas Date: Thu, 8 Oct 2020 17:19:17 +0200 Subject: [PATCH 1/5] Update AssociationsBasics.md --- Documentation/AssociationsBasics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/AssociationsBasics.md b/Documentation/AssociationsBasics.md index b057948dd..9fb15f9f3 100644 --- a/Documentation/AssociationsBasics.md +++ b/Documentation/AssociationsBasics.md @@ -116,7 +116,7 @@ Loading all books from an existing author is now easier: let books = try author.books.fetchAll(db) ``` -As for loading all pairs of books and authors, it is not only easier, but also *far much efficient*: +As for loading all pairs of books and authors, it is not only easier, but also *much more efficient*: ```swift struct BookInfo: FetchableRecord, Decodable { From 5e2bb1d57a2bad5538b28d271b757a6935583a2b Mon Sep 17 00:00:00 2001 From: Matt Tancock Date: Thu, 15 Oct 2020 15:10:28 +0100 Subject: [PATCH 2/5] Add buildActiveScheme to playground settings so they'll build under Xcode 12 --- .../Playgrounds/Associations.playground/contents.xcplayground | 2 +- .../contents.xcplayground | 2 +- .../Playgrounds/MyPlayground.playground/contents.xcplayground | 2 +- Documentation/Playgrounds/Tour.playground/contents.xcplayground | 2 +- .../TransactionObserver.playground/contents.xcplayground | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/Playgrounds/Associations.playground/contents.xcplayground b/Documentation/Playgrounds/Associations.playground/contents.xcplayground index 63b6dd8df..a8211e594 100644 --- a/Documentation/Playgrounds/Associations.playground/contents.xcplayground +++ b/Documentation/Playgrounds/Associations.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground b/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground index 3a493ef23..ec88aeaa8 100644 --- a/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground +++ b/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground b/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground index 63b6dd8df..a8211e594 100644 --- a/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground +++ b/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/Tour.playground/contents.xcplayground b/Documentation/Playgrounds/Tour.playground/contents.xcplayground index fd676d5b4..08c51997a 100644 --- a/Documentation/Playgrounds/Tour.playground/contents.xcplayground +++ b/Documentation/Playgrounds/Tour.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground b/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground index 3de2b51ba..3e9bf27b1 100644 --- a/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground +++ b/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file From 2a7f41c494408194c5242a0013ad0a1c24dd5512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 25 Oct 2020 10:12:42 +0100 Subject: [PATCH 3/5] Database.close() is idempotent This change addresses https://bugs.swift.org/browse/SR-13746 --- GRDB/Core/Database.swift | 5 ++++- GRDB/Core/SerializedDatabase.swift | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index ef83e5e36..320020a8b 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -355,7 +355,10 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib /// This method must be called before database deallocation func close() { SchedulingWatchdog.preconditionValidQueue(self) - assert(!isClosed) + + if isClosed { + return + } configuration.SQLiteConnectionWillClose?(sqliteConnection) internalStatementCache.clear() diff --git a/GRDB/Core/SerializedDatabase.swift b/GRDB/Core/SerializedDatabase.swift index f98055d43..ed7ddd08c 100644 --- a/GRDB/Core/SerializedDatabase.swift +++ b/GRDB/Core/SerializedDatabase.swift @@ -55,6 +55,12 @@ final class SerializedDatabase { do { try db.setUp() } catch { + // Recent versions of the Swift compiler will call the + // deinitializer. Older ones won't. + // See https://bugs.swift.org/browse/SR-13746 for details. + // + // So let's close the database now. The deinitializer + // will only close the database if needed. db.close() throw error } From 38682c69dac09691f1ede6f3a432857f955065c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 25 Oct 2020 10:15:27 +0100 Subject: [PATCH 4/5] CHANGELOG --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d1c4f8c..b4e9473af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: #### 5.x Releases - +- [Next Release](#next-release) - `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) - `5.0.0` Betas - [5.0.0-beta](#500-beta) | [5.0.0-beta.2](#500-beta2) | [5.0.0-beta.3](#500-beta3) | [5.0.0-beta.4](#500-beta4) | [5.0.0-beta.5](#500-beta5) | [5.0.0-beta.6](#500-beta6) | [5.0.0-beta.7](#500-beta7) | [5.0.0-beta.8](#500-beta8) | [5.0.0-beta.9](#500-beta9) | [5.0.0-beta.10](#500-beta10) | [5.0.0-beta.11](#500-beta11) @@ -68,6 +68,10 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: - [0.110.0](#01100), ... +## Next Release + +- **Fixed**: [#859](https://github.com/groue/GRDB.swift/pull/859): Database.close() is idempotent + ## 5.0.2 From 079c476148438f37b1d8ea77c6b47691ef7128c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 25 Oct 2020 10:30:55 +0100 Subject: [PATCH 5/5] v5.0.3 --- CHANGELOG.md | 9 ++++++--- GRDB.swift.podspec | 2 +- Makefile | 4 ++-- README.md | 4 ++-- Support/Info.plist | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e9473af..a68c5a831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,9 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: #### 5.x Releases -- [Next Release](#next-release) + -- `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) +- `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) | [5.0.3](#503) - `5.0.0` Betas - [5.0.0-beta](#500-beta) | [5.0.0-beta.2](#500-beta2) | [5.0.0-beta.3](#500-beta3) | [5.0.0-beta.4](#500-beta4) | [5.0.0-beta.5](#500-beta5) | [5.0.0-beta.6](#500-beta6) | [5.0.0-beta.7](#500-beta7) | [5.0.0-beta.8](#500-beta8) | [5.0.0-beta.9](#500-beta9) | [5.0.0-beta.10](#500-beta10) | [5.0.0-beta.11](#500-beta11) @@ -68,7 +68,10 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: - [0.110.0](#01100), ... -## Next Release + +## 5.0.3 + +Released October 25, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.2...v5.0.3) - **Fixed**: [#859](https://github.com/groue/GRDB.swift/pull/859): Database.close() is idempotent diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index 69ca1a17c..9b3318914 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GRDB.swift' - s.version = '5.0.2' + s.version = '5.0.3' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A toolkit for SQLite databases, with a focus on application development.' diff --git a/Makefile b/Makefile index 482062b4a..a03213113 100644 --- a/Makefile +++ b/Makefile @@ -409,8 +409,8 @@ ifdef JAZZY --author 'Gwendal Roué' \ --author_url https://github.com/groue \ --github_url https://github.com/groue/GRDB.swift \ - --github-file-prefix https://github.com/groue/GRDB.swift/tree/v5.0.2 \ - --module-version 5.0.2 \ + --github-file-prefix https://github.com/groue/GRDB.swift/tree/v5.0.3 \ + --module-version 5.0.3 \ --module GRDB \ --root-url http://groue.github.io/GRDB.swift/docs/5.0/ \ --output Documentation/Reference \ diff --git a/README.md b/README.md index 94c0d9216..d1959aad3 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ --- -**Latest release**: October 6, 2020 • version 5.0.2 • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md) +**Latest release**: October 6, 2020 • version 5.0.3 • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md) **Requirements**: iOS 10.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ • Swift 5.2+ / Xcode 11.4+ | Swift version | GRDB version | | -------------- | ----------------------------------------------------------- | -| **Swift 5.2+** | **v5.0.2** | +| **Swift 5.2+** | **v5.0.3** | | Swift 5.1 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) | | Swift 5 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) | | Swift 4.2 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) | diff --git a/Support/Info.plist b/Support/Info.plist index 78ab3233f..ae9b15513 100644 --- a/Support/Info.plist +++ b/Support/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.0.2 + 5.0.3 CFBundleSignature ???? CFBundleVersion