From bbbe0d899dd1031e960ebda95922aece3a85c1cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 20 Jul 2024 11:17:13 +0200
Subject: [PATCH 001/331] v6.29.0
---
CHANGELOG.md | 8 ++++++++
Documentation/ReleaseProcess.md | 6 ++++--
GRDB.swift.podspec | 2 +-
README.md | 2 +-
Support/Info.plist | 2 +-
5 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9d31c3a7e..ec95cb192 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
#### 6.x Releases
+- `6.29.x` Releases - [6.29.0](#6290)
- `6.28.x` Releases - [6.28.0](#6280)
- `6.27.x` Releases - [6.27.0](#6270)
- `6.26.x` Releases - [6.26.0](#6260)
@@ -126,6 +127,13 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
---
+## 6.29.0
+
+Released July 20, 2024
+
+- **New**: [#1574](https://github.com/groue/GRDB.swift/pull/1574) by [@sroebert](https://github.com/sroebert): Support for single value decoding (the complement of [#1570](https://github.com/groue/GRDB.swift/pull/1570) shipped in 6.28.0)
+- **New**: [#1575](https://github.com/groue/GRDB.swift/pull/1575) by [@Jason-Abbott](https://github.com/Jason-Abbott): Show comments when tracing expanded statements
+
## 6.28.0
Released July 11, 2024
diff --git a/Documentation/ReleaseProcess.md b/Documentation/ReleaseProcess.md
index 008b24d66..08210d740 100644
--- a/Documentation/ReleaseProcess.md
+++ b/Documentation/ReleaseProcess.md
@@ -18,8 +18,10 @@ To release a new GRDB version:
- README.md
- Support/Info.plist
- Commit and tag
-- Check tag authors: `git for-each-ref --format '%(refname) %(authorname)' refs/tags`
-- Push to the master & development branch
+- Look for undesired tags: `git for-each-ref --format '%(refname) %(authorname)' refs/tags`
+- Push to the `master` branch
+- Push to the `development` branch
+- Push to the `GRDB6` branch
- `pod trunk push --allow-warnings GRDB.swift.podspec`
- Update [performance comparison](https://github.com/groue/GRDB.swift/wiki/Performance):
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index 9c58025bc..8436768f3 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
- s.version = '6.28.0'
+ s.version = '6.29.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
diff --git a/README.md b/README.md
index 79838cbd2..b45d3bd5d 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-**Latest release**: July 11, 2024 • [version 6.28.0](https://github.com/groue/GRDB.swift/tree/v6.28.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
+**Latest release**: July 20, 2024 • [version 6.29.0](https://github.com/groue/GRDB.swift/tree/v6.29.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 14+
diff --git a/Support/Info.plist b/Support/Info.plist
index a9a6ba2d3..53b987969 100644
--- a/Support/Info.plist
+++ b/Support/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 6.28.0
+ 6.29.0
CFBundleSignature
????
CFBundleVersion
From cdc0131369513f8a7e54fdb295e92e3e3f7d5235 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 20 Jul 2024 14:38:14 +0200
Subject: [PATCH 002/331] Modernize demo apps:
iOS 17+
GRDBQuery 0.9.0
#Preview macro
---
.../GRDBAsyncDemo.xcodeproj/project.pbxproj | 6 ++--
.../xcshareddata/swiftpm/Package.resolved | 4 +--
.../GRDBAsyncDemo/GRDBAsyncDemoApp.swift | 20 ++++---------
.../GRDBAsyncDemo/PlayerRequest.swift | 28 +++----------------
.../GRDBAsyncDemo/Views/AppView.swift | 22 +++++++--------
.../Views/PlayerCreationView.swift | 8 +++---
.../Views/PlayerEditionView.swift | 14 +++++-----
.../GRDBAsyncDemo/Views/PlayerFormView.swift | 23 +++++++--------
.../GRDBAsyncDemo/Views/PlayerList.swift | 18 ++++++------
.../PlayerRequestTests.swift | 4 +--
.../GRDBCombineDemo.xcodeproj/project.pbxproj | 4 +++
.../xcshareddata/swiftpm/Package.resolved | 4 +--
.../GRDBCombineDemo/GRDBCombineDemoApp.swift | 20 ++++---------
.../GRDBCombineDemo/PlayerRequest.swift | 28 +++----------------
.../GRDBCombineDemo/Views/AppView.swift | 22 +++++++--------
.../Views/PlayerCreationView.swift | 8 +++---
.../Views/PlayerEditionView.swift | 14 +++++-----
.../Views/PlayerFormView.swift | 23 +++++++--------
.../GRDBCombineDemo/Views/PlayerList.swift | 18 ++++++------
.../PlayerRequestTests.swift | 4 +--
.../GRDBDemoiOS.xcodeproj/project.pbxproj | 4 +++
21 files changed, 126 insertions(+), 170 deletions(-)
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.pbxproj b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.pbxproj
index ceb3cb987..7b04e5beb 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.pbxproj
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.pbxproj
@@ -354,6 +354,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBAsyncDemoTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -373,6 +374,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBAsyncDemoTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -512,7 +514,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBAsyncDemo/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -534,7 +536,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBAsyncDemo/Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 5a507d565..216295601 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/groue/GRDBQuery",
"state" : {
- "revision" : "aefc0d7e7a64e841da33e1c8be7429da1bd9b5d6",
- "version" : "0.6.0"
+ "revision" : "a6c46dd38ecf11a5c37732870dc03a384d582fba",
+ "version" : "0.9.0"
}
}
],
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/GRDBAsyncDemoApp.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/GRDBAsyncDemoApp.swift
index 0ddda97f5..748b10a90 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/GRDBAsyncDemoApp.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/GRDBAsyncDemoApp.swift
@@ -5,17 +5,12 @@ import SwiftUI
struct GRDBAsyncDemoApp: App {
var body: some Scene {
WindowGroup {
- AppView().environment(\.appDatabase, .shared)
+ AppView().appDatabase(.shared)
}
}
}
// MARK: - Give SwiftUI access to the database
-//
-// Define a new environment key that grants access to an AppDatabase.
-//
-// The technique is documented at
-// .
private struct AppDatabaseKey: EnvironmentKey {
static var defaultValue: AppDatabase { .empty() }
@@ -28,13 +23,10 @@ extension EnvironmentValues {
}
}
-// In this demo app, views observe the database with the @Query property
-// wrapper, defined in the GRDBQuery package. Its documentation recommends to
-// define a dedicated initializer for `appDatabase` access, so we comply:
-
-extension Query where Request.DatabaseContext == AppDatabase {
- /// Convenience initializer for requests that feed from `AppDatabase`.
- init(_ request: Request) {
- self.init(request, in: \.appDatabase)
+extension View {
+ func appDatabase(_ appDatabase: AppDatabase) -> some View {
+ self
+ .environment(\.appDatabase, appDatabase)
+ .databaseContext(.readOnly { appDatabase.reader })
}
}
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/PlayerRequest.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/PlayerRequest.swift
index 8c70aab8d..4d1d92460 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/PlayerRequest.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/PlayerRequest.swift
@@ -1,4 +1,3 @@
-import Combine
import GRDB
import GRDBQuery
@@ -14,37 +13,18 @@ import GRDBQuery
/// List(players) { player in ... )
/// }
/// }
-struct PlayerRequest: Queryable {
+struct PlayerRequest: ValueObservationQueryable {
enum Ordering {
case byScore
case byName
}
+ static var defaultValue: [Player] { [] }
+
/// The ordering used by the player request.
var ordering: Ordering
- // MARK: - Queryable Implementation
-
- static var defaultValue: [Player] { [] }
-
- func publisher(in appDatabase: AppDatabase) -> AnyPublisher<[Player], Error> {
- // Build the publisher from the general-purpose read-only access
- // granted by `appDatabase.reader`.
- // Some apps will prefer to call a dedicated method of `appDatabase`.
- ValueObservation
- .tracking(fetchValue(_:))
- .publisher(
- in: appDatabase.reader,
- // The `.immediate` scheduling feeds the view right on
- // subscription, and avoids an undesired animation when the
- // application starts.
- scheduling: .immediate)
- .eraseToAnyPublisher()
- }
-
- // This method is not required by Queryable, but it makes it easier
- // to test PlayerRequest.
- func fetchValue(_ db: Database) throws -> [Player] {
+ func fetch(_ db: Database) throws -> [Player] {
switch ordering {
case .byScore:
return try Player.all().orderedByScore().fetchAll(db)
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/AppView.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/AppView.swift
index 1eda4c442..562b4aee8 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/AppView.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/AppView.swift
@@ -43,7 +43,7 @@ struct AppView: View {
stopEditing()
}))
.toolbar { toolbarContent }
- .onChange(of: players) { players in
+ .onChange(of: players) {
if players.isEmpty {
stopEditing()
}
@@ -141,14 +141,14 @@ private struct ToggleOrderingButton: View {
}
}
-struct AppView_Previews: PreviewProvider {
- static var previews: some View {
- Group {
- // Preview the default, empty database
- AppView()
-
- // Preview a database of random players
- AppView().environment(\.appDatabase, .random())
- }
- }
+// MARK: - Previews
+
+#Preview("Empty") {
+ // Preview the default, empty database
+ AppView()
+}
+
+#Preview("Populated") {
+ // Preview a database of random players
+ AppView().appDatabase(.random())
}
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerCreationView.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerCreationView.swift
index b71a3c2aa..a47fdd04d 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerCreationView.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerCreationView.swift
@@ -43,8 +43,8 @@ struct PlayerCreationView: View {
}
}
-struct PlayerCreationSheet_Previews: PreviewProvider {
- static var previews: some View {
- PlayerCreationView()
- }
+// MARK: - Previews
+
+#Preview {
+ PlayerCreationView()
}
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerEditionView.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerEditionView.swift
index 79f524506..1ab97677d 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerEditionView.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerEditionView.swift
@@ -15,7 +15,7 @@ struct PlayerEditionView: View {
var body: some View {
PlayerFormView(form: $form)
- .onChange(of: isPresented) { isPresented in
+ .onChange(of: isPresented) {
// Save when back button is pressed
if !isPresented {
Task {
@@ -30,11 +30,11 @@ struct PlayerEditionView: View {
}
}
-struct PlayerEditionView_Previews: PreviewProvider {
- static var previews: some View {
- NavigationView {
- PlayerEditionView(player: Player.makeRandom())
- .navigationBarTitle("Player Edition")
- }
+// MARK: - Previews
+
+#Preview {
+ NavigationView {
+ PlayerEditionView(player: Player.makeRandom())
+ .navigationBarTitle("Player Edition")
}
}
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerFormView.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerFormView.swift
index bc7883e28..590506d46 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerFormView.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerFormView.swift
@@ -33,15 +33,16 @@ extension PlayerForm {
}
}
-struct PlayerFormView_Previews: PreviewProvider {
- static var previews: some View {
- Group {
- PlayerFormView(form: .constant(PlayerForm(
- name: "",
- score: "")))
- PlayerFormView(form: .constant(PlayerForm(
- name: Player.randomName(),
- score: "\(Player.randomScore())")))
- }
- }
+// MARK: - Previews
+
+#Preview("Empty") {
+ PlayerFormView(form: .constant(PlayerForm(
+ name: "",
+ score: "")))
+}
+
+#Preview("Prefilled") {
+ PlayerFormView(form: .constant(PlayerForm(
+ name: Player.randomName(),
+ score: "\(Player.randomScore())")))
}
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerList.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerList.swift
index b4ec9cee0..f156f786c 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerList.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/Views/PlayerList.swift
@@ -46,14 +46,14 @@ private struct PlayerRow: View {
}
}
-struct PlayerList_Previews: PreviewProvider {
- static var previews: some View {
- NavigationView {
- PlayerList(players: [
- Player(id: 1, name: "Arthur", score: 100),
- Player(id: 2, name: "Barbara", score: 1000),
- ])
- .navigationTitle("Preview")
- }
+// MARK: - Previews
+
+#Preview {
+ NavigationView {
+ PlayerList(players: [
+ Player(id: 1, name: "Arthur", score: 100),
+ Player(id: 2, name: "Barbara", score: 1000),
+ ])
+ .navigationTitle("Preview")
}
}
diff --git a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemoTests/PlayerRequestTests.swift b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemoTests/PlayerRequestTests.swift
index 2675f82d5..71d82ab40 100644
--- a/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemoTests/PlayerRequestTests.swift
+++ b/Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemoTests/PlayerRequestTests.swift
@@ -16,7 +16,7 @@ class PlayerRequestTests: XCTestCase {
// When we fetch players ordered by name
let playerRequest = PlayerRequest(ordering: .byName)
- let players = try dbQueue.read(playerRequest.fetchValue)
+ let players = try dbQueue.read(playerRequest.fetch)
// Then the players are the two players ordered by name
XCTAssertEqual(players, [player1, player2])
@@ -35,7 +35,7 @@ class PlayerRequestTests: XCTestCase {
// When we fetch players ordered by score
let playerRequest = PlayerRequest(ordering: .byScore)
- let players = try dbQueue.read(playerRequest.fetchValue)
+ let players = try dbQueue.read(playerRequest.fetch)
// Then the players are the two players ordered by score descending
XCTAssertEqual(players, [player2, player1])
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.pbxproj b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.pbxproj
index 5435eaded..f1892a540 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.pbxproj
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.pbxproj
@@ -354,6 +354,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBCombineDemoTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -373,6 +374,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = GRDBCombineDemoTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -512,6 +514,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -533,6 +536,7 @@
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = GRDBCombineDemo/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 5a507d565..216295601 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/groue/GRDBQuery",
"state" : {
- "revision" : "aefc0d7e7a64e841da33e1c8be7429da1bd9b5d6",
- "version" : "0.6.0"
+ "revision" : "a6c46dd38ecf11a5c37732870dc03a384d582fba",
+ "version" : "0.9.0"
}
}
],
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/GRDBCombineDemoApp.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/GRDBCombineDemoApp.swift
index 3565a31cb..27db2c5ea 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/GRDBCombineDemoApp.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/GRDBCombineDemoApp.swift
@@ -5,17 +5,12 @@ import SwiftUI
struct GRDBCombineDemoApp: App {
var body: some Scene {
WindowGroup {
- AppView().environment(\.appDatabase, .shared)
+ AppView().appDatabase(.shared)
}
}
}
// MARK: - Give SwiftUI access to the database
-//
-// Define a new environment key that grants access to an AppDatabase.
-//
-// The technique is documented at
-// .
private struct AppDatabaseKey: EnvironmentKey {
static var defaultValue: AppDatabase { .empty() }
@@ -28,13 +23,10 @@ extension EnvironmentValues {
}
}
-// In this demo app, views observe the database with the @Query property
-// wrapper, defined in the GRDBQuery package. Its documentation recommends to
-// define a dedicated initializer for `appDatabase` access, so we comply:
-
-extension Query where Request.DatabaseContext == AppDatabase {
- /// Convenience initializer for requests that feed from `AppDatabase`.
- init(_ request: Request) {
- self.init(request, in: \.appDatabase)
+extension View {
+ func appDatabase(_ appDatabase: AppDatabase) -> some View {
+ self
+ .environment(\.appDatabase, appDatabase)
+ .databaseContext(.readOnly { appDatabase.reader })
}
}
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/PlayerRequest.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/PlayerRequest.swift
index 8c70aab8d..4d1d92460 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/PlayerRequest.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/PlayerRequest.swift
@@ -1,4 +1,3 @@
-import Combine
import GRDB
import GRDBQuery
@@ -14,37 +13,18 @@ import GRDBQuery
/// List(players) { player in ... )
/// }
/// }
-struct PlayerRequest: Queryable {
+struct PlayerRequest: ValueObservationQueryable {
enum Ordering {
case byScore
case byName
}
+ static var defaultValue: [Player] { [] }
+
/// The ordering used by the player request.
var ordering: Ordering
- // MARK: - Queryable Implementation
-
- static var defaultValue: [Player] { [] }
-
- func publisher(in appDatabase: AppDatabase) -> AnyPublisher<[Player], Error> {
- // Build the publisher from the general-purpose read-only access
- // granted by `appDatabase.reader`.
- // Some apps will prefer to call a dedicated method of `appDatabase`.
- ValueObservation
- .tracking(fetchValue(_:))
- .publisher(
- in: appDatabase.reader,
- // The `.immediate` scheduling feeds the view right on
- // subscription, and avoids an undesired animation when the
- // application starts.
- scheduling: .immediate)
- .eraseToAnyPublisher()
- }
-
- // This method is not required by Queryable, but it makes it easier
- // to test PlayerRequest.
- func fetchValue(_ db: Database) throws -> [Player] {
+ func fetch(_ db: Database) throws -> [Player] {
switch ordering {
case .byScore:
return try Player.all().orderedByScore().fetchAll(db)
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/AppView.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/AppView.swift
index 0879f3430..7c93e15cb 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/AppView.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/AppView.swift
@@ -43,7 +43,7 @@ struct AppView: View {
stopEditing()
}))
.toolbar { toolbarContent }
- .onChange(of: players) { players in
+ .onChange(of: players) {
if players.isEmpty {
stopEditing()
}
@@ -132,14 +132,14 @@ private struct ToggleOrderingButton: View {
}
}
-struct AppView_Previews: PreviewProvider {
- static var previews: some View {
- Group {
- // Preview the default, empty database
- AppView()
-
- // Preview a database of random players
- AppView().environment(\.appDatabase, .random())
- }
- }
+// MARK: - Previews
+
+#Preview("Empty") {
+ // Preview the default, empty database
+ AppView()
+}
+
+#Preview("Populated") {
+ // Preview a database of random players
+ AppView().appDatabase(.random())
}
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerCreationView.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerCreationView.swift
index 1c78289a9..f86876fd9 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerCreationView.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerCreationView.swift
@@ -43,8 +43,8 @@ struct PlayerCreationView: View {
}
}
-struct PlayerCreationSheet_Previews: PreviewProvider {
- static var previews: some View {
- PlayerCreationView()
- }
+// MARK: - Previews
+
+#Preview {
+ PlayerCreationView()
}
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerEditionView.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerEditionView.swift
index a3bde6aa8..a3c559a1a 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerEditionView.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerEditionView.swift
@@ -15,7 +15,7 @@ struct PlayerEditionView: View {
var body: some View {
PlayerFormView(form: $form)
- .onChange(of: isPresented) { isPresented in
+ .onChange(of: isPresented) {
// Save when back button is pressed
if !isPresented {
var savedPlayer = player
@@ -28,11 +28,11 @@ struct PlayerEditionView: View {
}
}
-struct PlayerEditionView_Previews: PreviewProvider {
- static var previews: some View {
- NavigationView {
- PlayerEditionView(player: Player.makeRandom())
- .navigationBarTitle("Player Edition")
- }
+// MARK: - Previews
+
+#Preview {
+ NavigationView {
+ PlayerEditionView(player: Player.makeRandom())
+ .navigationBarTitle("Player Edition")
}
}
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerFormView.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerFormView.swift
index bc7883e28..590506d46 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerFormView.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerFormView.swift
@@ -33,15 +33,16 @@ extension PlayerForm {
}
}
-struct PlayerFormView_Previews: PreviewProvider {
- static var previews: some View {
- Group {
- PlayerFormView(form: .constant(PlayerForm(
- name: "",
- score: "")))
- PlayerFormView(form: .constant(PlayerForm(
- name: Player.randomName(),
- score: "\(Player.randomScore())")))
- }
- }
+// MARK: - Previews
+
+#Preview("Empty") {
+ PlayerFormView(form: .constant(PlayerForm(
+ name: "",
+ score: "")))
+}
+
+#Preview("Prefilled") {
+ PlayerFormView(form: .constant(PlayerForm(
+ name: Player.randomName(),
+ score: "\(Player.randomScore())")))
}
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerList.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerList.swift
index 1b41a8bc4..7913c73c6 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerList.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/Views/PlayerList.swift
@@ -44,14 +44,14 @@ private struct PlayerRow: View {
}
}
-struct PlayerList_Previews: PreviewProvider {
- static var previews: some View {
- NavigationView {
- PlayerList(players: [
- Player(id: 1, name: "Arthur", score: 100),
- Player(id: 2, name: "Barbara", score: 1000),
- ])
- .navigationTitle("Preview")
- }
+// MARK: - Previews
+
+#Preview {
+ NavigationView {
+ PlayerList(players: [
+ Player(id: 1, name: "Arthur", score: 100),
+ Player(id: 2, name: "Barbara", score: 1000),
+ ])
+ .navigationTitle("Preview")
}
}
diff --git a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemoTests/PlayerRequestTests.swift b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemoTests/PlayerRequestTests.swift
index 151d8e41e..c9e58da1e 100644
--- a/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemoTests/PlayerRequestTests.swift
+++ b/Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemoTests/PlayerRequestTests.swift
@@ -16,7 +16,7 @@ class PlayerRequestTests: XCTestCase {
// When we fetch players ordered by name
let playerRequest = PlayerRequest(ordering: .byName)
- let players = try dbQueue.read(playerRequest.fetchValue)
+ let players = try dbQueue.read(playerRequest.fetch)
// Then the players are the two players ordered by name
XCTAssertEqual(players, [player1, player2])
@@ -35,7 +35,7 @@ class PlayerRequestTests: XCTestCase {
// When we fetch players ordered by score
let playerRequest = PlayerRequest(ordering: .byScore)
- let players = try dbQueue.read(playerRequest.fetchValue)
+ let players = try dbQueue.read(playerRequest.fetch)
// Then the players are the two players ordered by score descending
XCTAssertEqual(players, [player2, player1])
diff --git a/Documentation/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj b/Documentation/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj
index 4d38142d0..827e5c560 100644
--- a/Documentation/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj
+++ b/Documentation/DemoApps/GRDBDemoiOS/GRDBDemoiOS.xcodeproj/project.pbxproj
@@ -588,6 +588,7 @@
DEVELOPMENT_TEAM = AMD8W895CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -614,6 +615,7 @@
DEVELOPMENT_TEAM = AMD8W895CT;
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = GRDBDemoiOSTests/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -828,6 +830,7 @@
CLANG_ENABLE_OBJC_WEAK = YES;
DEVELOPMENT_TEAM = AMD8W895CT;
INFOPLIST_FILE = GRDBDemoiOS/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -845,6 +848,7 @@
CLANG_ENABLE_OBJC_WEAK = YES;
DEVELOPMENT_TEAM = AMD8W895CT;
INFOPLIST_FILE = GRDBDemoiOS/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
From 78377d5cc03dd5e00b21ae7ab464094e0faa6fe1 Mon Sep 17 00:00:00 2001
From: Sagar Dagdu
Date: Tue, 30 Jul 2024 20:21:26 +0530
Subject: [PATCH 003/331] Update README to highlight deployment issue with
CocoaPods
---
README.md | 38 ++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index b45d3bd5d..a7402c370 100644
--- a/README.md
+++ b/README.md
@@ -340,16 +340,6 @@ See [Encryption](#encryption) for the installation procedure of GRDB with SQLCip
See [Custom SQLite builds](Documentation/CustomSQLiteBuilds.md) for the installation procedure of GRDB with a customized build of SQLite.
-## CocoaPods
-
-[CocoaPods](http://cocoapods.org/) is a dependency manager for Xcode projects. To use GRDB with CocoaPods (version 1.2 or higher), specify in your `Podfile`:
-
-```ruby
-pod 'GRDB.swift'
-```
-
-GRDB can be installed as a framework, or a static library.
-
## Swift Package Manager
The [Swift Package Manager](https://swift.org/package-manager/) automates the distribution of Swift code. To use GRDB with SPM, add a dependency to `https://github.com/groue/GRDB.swift.git`
@@ -360,6 +350,34 @@ GRDB offers two libraries, `GRDB` and `GRDB-dynamic`. Pick only one. When in dou
>
> **Warning**: Due to an Xcode bug, you will get "No such module 'CSQLite'" errors when you want to embed the GRDB package in other targets than the main application (watch extensions, for example). UI and Unit testing targets are OK, though. See [#642](https://github.com/groue/GRDB.swift/issues/642#issuecomment-575994093) for more information.
+
+## CocoaPods
+
+[CocoaPods](http://cocoapods.org/) is a dependency manager for Xcode projects. To use GRDB with CocoaPods (version 1.2 or higher), specify in your `Podfile`:
+
+```ruby
+pod 'GRDB.swift'
+```
+
+### ⚠️ Important Note for CocoaPods installation
+
+Due to an [issue](https://github.com/CocoaPods/CocoaPods/issues/11839) in CocoaPods, it is currently not possible to deploy new versions of GRDB to CocoaPods. The last version available on CocoaPods is 6.24.1. If you want to install later versions of GRDB using CocoaPods, please use one of the following workarounds:
+
+- Depend on the `GRDB6` branch. This is more or less equivalent to what `pod 'GRDB.swift', '~> 6.0'` would normally do, if CocoaPods would accept new GRDB versions to be published:
+```ruby
+# Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
+pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', branch: 'GRDB6'
+```
+- Depend on a specific version explicitly (Replace the tag with the version you want to use):
+```ruby
+# Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
+# Replace the tag with the tag that you want to use.
+pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', tag: 'v6.29.0'
+```
+Once CocoaPods resolves this issue and allows deployment of new GRDB versions, users will be able to return to the standard installation method described at the beginning of this section.
+
+GRDB can be installed as a framework, or a static library.
+
## Carthage
[Carthage](https://github.com/Carthage/Carthage) is **unsupported**. For some context about this decision, see [#433](https://github.com/groue/GRDB.swift/issues/433).
From 8205f02672a7ac970b6acd81c01ca6e12eee2093 Mon Sep 17 00:00:00 2001
From: Sagar Dagdu
Date: Tue, 30 Jul 2024 20:54:24 +0530
Subject: [PATCH 004/331] Address code review comments
---
README.md | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index a7402c370..6517d92a3 100644
--- a/README.md
+++ b/README.md
@@ -359,24 +359,23 @@ GRDB offers two libraries, `GRDB` and `GRDB-dynamic`. Pick only one. When in dou
pod 'GRDB.swift'
```
-### ⚠️ Important Note for CocoaPods installation
+GRDB can be installed as a framework, or a static library.
-Due to an [issue](https://github.com/CocoaPods/CocoaPods/issues/11839) in CocoaPods, it is currently not possible to deploy new versions of GRDB to CocoaPods. The last version available on CocoaPods is 6.24.1. If you want to install later versions of GRDB using CocoaPods, please use one of the following workarounds:
+**Important Note for CocoaPods installation**
+
+Due to an [issue](https://github.com/CocoaPods/CocoaPods/issues/11839) in CocoaPods, it is currently not possible to deploy new versions of GRDB to CocoaPods. The last version available on CocoaPods is 6.24.1. To install later versions of GRDB using CocoaPods, use one of the following workarounds:
- Depend on the `GRDB6` branch. This is more or less equivalent to what `pod 'GRDB.swift', '~> 6.0'` would normally do, if CocoaPods would accept new GRDB versions to be published:
```ruby
-# Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
-pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', branch: 'GRDB6'
+ # Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
+ pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', branch: 'GRDB6'
```
- Depend on a specific version explicitly (Replace the tag with the version you want to use):
```ruby
-# Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
-# Replace the tag with the tag that you want to use.
-pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', tag: 'v6.29.0'
+ # Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
+ # Replace the tag with the tag that you want to use.
+ pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', tag: 'v6.29.0'
```
-Once CocoaPods resolves this issue and allows deployment of new GRDB versions, users will be able to return to the standard installation method described at the beginning of this section.
-
-GRDB can be installed as a framework, or a static library.
## Carthage
From 9da1a83cca8a9e71fee5cf06388616dde85d9278 Mon Sep 17 00:00:00 2001
From: Sagar Dagdu
Date: Tue, 30 Jul 2024 21:00:14 +0530
Subject: [PATCH 005/331] Fix indentation for code blocks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Gwendal Roué
---
README.md | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 6517d92a3..367669b35 100644
--- a/README.md
+++ b/README.md
@@ -366,16 +366,19 @@ GRDB can be installed as a framework, or a static library.
Due to an [issue](https://github.com/CocoaPods/CocoaPods/issues/11839) in CocoaPods, it is currently not possible to deploy new versions of GRDB to CocoaPods. The last version available on CocoaPods is 6.24.1. To install later versions of GRDB using CocoaPods, use one of the following workarounds:
- Depend on the `GRDB6` branch. This is more or less equivalent to what `pod 'GRDB.swift', '~> 6.0'` would normally do, if CocoaPods would accept new GRDB versions to be published:
-```ruby
+
+ ```ruby
# Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', branch: 'GRDB6'
-```
+ ```
+
- Depend on a specific version explicitly (Replace the tag with the version you want to use):
-```ruby
+
+ ```ruby
# Can't use semantic versioning due to https://github.com/CocoaPods/CocoaPods/issues/11839
# Replace the tag with the tag that you want to use.
pod 'GRDB.swift', git: 'https://github.com/groue/GRDB.swift.git', tag: 'v6.29.0'
-```
+ ```
## Carthage
From 20ffddd5720908238f50b1233d225b0d85cd0330 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Rou=C3=A9?=
Date: Wed, 31 Jul 2024 12:51:26 +0200
Subject: [PATCH 006/331] Update TODO.md
---
TODO.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/TODO.md b/TODO.md
index 096a98127..17266e754 100644
--- a/TODO.md
+++ b/TODO.md
@@ -85,6 +85,7 @@
- [ ] Check https://sqlite.org/sqlar.html
- [ ] More schema alterations
- [ ] Database.clearSchemaCache() is fine, but what about dbPool readers? Can we invalidate the cache for a whole pool?
+- [ ] What can we do with `cross-module-optimization`? See https://github.com/apple/swift-homomorphic-encryption
## Unsure if necessary
From 344878cdb2e3af07f46954e3bc2b93541489bd82 Mon Sep 17 00:00:00 2001
From: Cameron Pulsford
Date: Tue, 6 Aug 2024 19:44:23 -0400
Subject: [PATCH 007/331] Fix compilation issue with Xcode 16 beta 5 due to a
missing import.
---
GRDB/Core/StatementAuthorizer.swift | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/GRDB/Core/StatementAuthorizer.swift b/GRDB/Core/StatementAuthorizer.swift
index e20883049..42691dbed 100644
--- a/GRDB/Core/StatementAuthorizer.swift
+++ b/GRDB/Core/StatementAuthorizer.swift
@@ -2,6 +2,10 @@
import Glibc
#endif
+#if canImport(Darwin)
+import Darwin
+#endif
+
/// `StatementAuthorizer` provides information about compiled database
/// statements, and prevents the truncate optimization when row deletions are
/// observed by transaction observers.
From 5b735811266eac0d5b07f9c6c990431a2059fb70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Wed, 7 Aug 2024 12:16:57 +0200
Subject: [PATCH 008/331] v6.29.1
---
CHANGELOG.md | 10 +++++++++-
GRDB.swift.podspec | 2 +-
README.md | 2 +-
Support/Info.plist | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ec95cb192..39fe55e5e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
#### 6.x Releases
-- `6.29.x` Releases - [6.29.0](#6290)
+- `6.29.x` Releases - [6.29.0](#6290) - [6.29.1](#6291)
- `6.28.x` Releases - [6.28.0](#6280)
- `6.27.x` Releases - [6.27.0](#6270)
- `6.26.x` Releases - [6.26.0](#6260)
@@ -127,6 +127,14 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
---
+## 6.29.1
+
+Released August 7, 2024
+
+- **New**: [#1579](https://github.com/groue/GRDB.swift/pull/1579) by [@groue](https://github.com/groue): Modernize the demo apps
+- **New**: [#1584](https://github.com/groue/GRDB.swift/pull/1584) by [@SagarSDagdu](https://github.com/SagarSDagdu): Update README to highlight deployment issue with CocoaPods
+- **New**: [#1589](https://github.com/groue/GRDB.swift/pull/1589) by [@groue](https://github.com/groue): Fix compilation issue with Xcode 16 beta 5 due to a missing import
+
## 6.29.0
Released July 20, 2024
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index 8436768f3..93b9790ef 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
- s.version = '6.29.0'
+ s.version = '6.29.1'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
diff --git a/README.md b/README.md
index 367669b35..3b3e53803 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-**Latest release**: July 20, 2024 • [version 6.29.0](https://github.com/groue/GRDB.swift/tree/v6.29.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
+**Latest release**: August 7, 2024 • [version 6.29.1](https://github.com/groue/GRDB.swift/tree/v6.29.1) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 14+
diff --git a/Support/Info.plist b/Support/Info.plist
index 53b987969..5ef52833c 100644
--- a/Support/Info.plist
+++ b/Support/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 6.29.0
+ 6.29.1
CFBundleSignature
????
CFBundleVersion
From f44134154331a64b373c5ee4f45fbeb25dcc69ce Mon Sep 17 00:00:00 2001
From: "Ming C."
Date: Sat, 17 Aug 2024 11:43:05 -0700
Subject: [PATCH 009/331] README.md: Fix sample code
---
README.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 3b3e53803..be3c783ff 100644
--- a/README.md
+++ b/README.md
@@ -5743,9 +5743,7 @@ Open a read-only connection to your resource:
// HOW TO open a read-only connection to a database resource
// Get the path to the database resource.
-if let dbPath = Bundle.main.path(forResource: "db", ofType: "sqlite")
-
-if let dbPath {
+if let dbPath = Bundle.main.path(forResource: "db", ofType: "sqlite") {
// If the resource exists, open a read-only connection.
// Writes are disallowed because resources can not be modified.
var config = Configuration()
From fcfdab2f11df7dd08e77bcd769ece6cb9f1261e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Thu, 22 Aug 2024 08:17:04 +0200
Subject: [PATCH 010/331] Import string_h for strcmp
Thanks to @karianneberg in https://github.com/groue/GRDB.swift/commit/344878cdb2e3af07f46954e3bc2b93541489bd82
---
GRDB/Core/StatementAuthorizer.swift | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/GRDB/Core/StatementAuthorizer.swift b/GRDB/Core/StatementAuthorizer.swift
index 42691dbed..54d905778 100644
--- a/GRDB/Core/StatementAuthorizer.swift
+++ b/GRDB/Core/StatementAuthorizer.swift
@@ -1,8 +1,8 @@
-#if os(Linux)
+#if canImport(string_h)
+import string_h
+#elseif os(Linux)
import Glibc
-#endif
-
-#if canImport(Darwin)
+#elseif os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
import Darwin
#endif
From d3d2a9c4f73cb4478385b7f164d5ac40dd9b70a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 10:26:34 +0200
Subject: [PATCH 011/331] Stop testing error messages that depend on the SQLite
version
---
Tests/GRDBTests/DatabaseConfigurationTests.swift | 5 -----
1 file changed, 5 deletions(-)
diff --git a/Tests/GRDBTests/DatabaseConfigurationTests.swift b/Tests/GRDBTests/DatabaseConfigurationTests.swift
index 7ff0f4702..88fdb622b 100644
--- a/Tests/GRDBTests/DatabaseConfigurationTests.swift
+++ b/Tests/GRDBTests/DatabaseConfigurationTests.swift
@@ -137,7 +137,6 @@ class DatabaseConfigurationTests: GRDBTestCase {
}
} catch let error as DatabaseError {
XCTAssertEqual(error.resultCode, .SQLITE_ERROR)
- XCTAssertEqual(error.message, "no such column: foo")
XCTAssertEqual(error.sql, "SELECT \"foo\" FROM player")
}
@@ -151,10 +150,6 @@ class DatabaseConfigurationTests: GRDBTestCase {
}
} catch let error as DatabaseError {
XCTAssertEqual(error.resultCode, .SQLITE_ERROR)
- XCTAssert([
- "no such column: foo",
- "table player has no column named foo"]
- .contains(error.message))
XCTAssertEqual(error.sql, "CREATE INDEX i ON player(\"foo\")")
}
}
From c64bc11627703977ef3d02ab8105fa192312d8e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 10 Feb 2024 17:15:52 +0100
Subject: [PATCH 012/331] Remove ill-advised TODO
This would force users to force-unwrap their custom `ColumnType(rawValue: "WHATEVER")!`
---
GRDB/Core/Database.swift | 3 ---
1 file changed, 3 deletions(-)
diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift
index 6281109b3..474373db5 100644
--- a/GRDB/Core/Database.swift
+++ b/GRDB/Core/Database.swift
@@ -124,8 +124,6 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib
// MARK: - SQLite C API
- // TODO: make it non optional, since one can't get a `Database` instance
- // after `close()`.
/// The raw SQLite connection, suitable for the SQLite C API.
///
/// The result is nil after the database has been successfully closed with
@@ -1923,7 +1921,6 @@ extension Database {
/// The SQL for the column type (`"TEXT"`, `"BLOB"`, etc.)
public let rawValue: String
- // TODO: GRDB7 make it an failable initializer that returns nil when rawValue is empty (or blank).
/// Creates an SQL column type.
public init(rawValue: String) {
self.rawValue = rawValue
From ae837a3a442b35dcf6a110f1487ccce13fdb43a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 11:46:45 +0200
Subject: [PATCH 013/331] v6.29.2
---
CHANGELOG.md | 8 +++++++-
GRDB.swift.podspec | 2 +-
README.md | 2 +-
Support/Info.plist | 2 +-
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39fe55e5e..bfb838235 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
#### 6.x Releases
-- `6.29.x` Releases - [6.29.0](#6290) - [6.29.1](#6291)
+- `6.29.x` Releases - [6.29.0](#6290) - [6.29.1](#6291) - [6.29.2](#6292)
- `6.28.x` Releases - [6.28.0](#6280)
- `6.27.x` Releases - [6.27.0](#6270)
- `6.26.x` Releases - [6.26.0](#6260)
@@ -127,6 +127,12 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
---
+## 6.29.2
+
+Released August 24, 2024
+
+- **New**: [#1593](https://github.com/groue/GRDB.swift/pull/1593) by [@mingchen](https://github.com/mingchen): Fix sample code in README
+
## 6.29.1
Released August 7, 2024
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index 93b9790ef..403fd74f9 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'GRDB.swift'
- s.version = '6.29.1'
+ s.version = '6.29.2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'
diff --git a/README.md b/README.md
index be3c783ff..a5a40d8fc 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
-**Latest release**: August 7, 2024 • [version 6.29.1](https://github.com/groue/GRDB.swift/tree/v6.29.1) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
+**Latest release**: August 24, 2024 • [version 6.29.2](https://github.com/groue/GRDB.swift/tree/v6.29.2) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 14+
diff --git a/Support/Info.plist b/Support/Info.plist
index 5ef52833c..08f23569d 100644
--- a/Support/Info.plist
+++ b/Support/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 6.29.1
+ 6.29.2
CFBundleSignature
????
CFBundleVersion
From f4b40357041b1e6f690a6117ba2b3c1cbf7c10c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 14:39:44 +0200
Subject: [PATCH 014/331] Fix Swiftlint warnings
---
GRDB/Core/Support/Foundation/SQLiteDateParser.swift | 1 -
GRDB/QueryInterface/SQL/SQLRelation.swift | 2 +-
GRDB/Record/EncodableRecord+Encodable.swift | 2 +-
Scripts/swiftlint.yml | 1 +
4 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/GRDB/Core/Support/Foundation/SQLiteDateParser.swift b/GRDB/Core/Support/Foundation/SQLiteDateParser.swift
index 4f234749d..74db8e5fd 100644
--- a/GRDB/Core/Support/Foundation/SQLiteDateParser.swift
+++ b/GRDB/Core/Support/Foundation/SQLiteDateParser.swift
@@ -4,7 +4,6 @@ import Foundation
@usableFromInline
struct SQLiteDateParser {
- // swiftlint:disable:next unneeded_synthesized_initializer
@usableFromInline
init() { }
diff --git a/GRDB/QueryInterface/SQL/SQLRelation.swift b/GRDB/QueryInterface/SQL/SQLRelation.swift
index 9f01841c2..4488cc96f 100644
--- a/GRDB/QueryInterface/SQL/SQLRelation.swift
+++ b/GRDB/QueryInterface/SQL/SQLRelation.swift
@@ -171,7 +171,7 @@ struct SQLRelation {
var source: SQLSource
var selectionPromise: DatabasePromise<[SQLSelection]>
var filterPromise: DatabasePromise?
- var ordering: SQLRelation.Ordering = SQLRelation.Ordering()
+ var ordering = SQLRelation.Ordering()
var ctes: OrderedDictionary = [:] // See also `allCTEs`
var children: OrderedDictionary = [:]
diff --git a/GRDB/Record/EncodableRecord+Encodable.swift b/GRDB/Record/EncodableRecord+Encodable.swift
index 4ecbd5f80..8ead9397b 100644
--- a/GRDB/Record/EncodableRecord+Encodable.swift
+++ b/GRDB/Record/EncodableRecord+Encodable.swift
@@ -223,7 +223,7 @@ extension RecordEncoder: SingleValueEncodingContainer {
unsupportedSingleValueEncoding()
}
- func encode(_ value: T) throws where T : Encodable {
+ func encode(_ value: T) throws where T: Encodable {
if let record = value as? EncodableRecord {
try record.encode(to: &_persistenceContainer)
} else {
diff --git a/Scripts/swiftlint.yml b/Scripts/swiftlint.yml
index af49e16e2..4c2448eb5 100644
--- a/Scripts/swiftlint.yml
+++ b/Scripts/swiftlint.yml
@@ -15,6 +15,7 @@ disabled_rules:
- is_disjoint
- large_tuple
- nesting
+ - non_optional_string_data_conversion
- opening_brace
- redundant_optional_initialization
- syntactic_sugar
From 8caf31296f208fa71bbdc51573ff7d0489c11979 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 14:49:25 +0200
Subject: [PATCH 015/331] [BREAKING] Xcode 16+, Swift 6+
---
GRDB.swift.podspec | 2 +-
GRDB/Core/DatabasePool.swift | 6 ++---
GRDB/Core/DatabaseSnapshotPool.swift | 3 +--
GRDB/Core/WALSnapshot.swift | 7 +++--
GRDB/Core/WALSnapshotTransaction.swift | 3 +--
.../Observers/ValueConcurrentObserver.swift | 3 +--
Package.swift | 2 +-
README.md | 2 +-
.../DatabaseReaderReadPublisherTests.swift | 12 ++++-----
.../DatabaseAbortedTransactionTests.swift | 4 +--
.../DatabaseConfigurationTests.swift | 4 +--
Tests/GRDBTests/DatabasePoolTests.swift | 8 +++---
Tests/GRDBTests/DatabaseReaderTests.swift | 26 +++++++++----------
.../GRDBTests/DatabaseSnapshotPoolTests.swift | 2 +-
.../ValueObservationPrintTests.swift | 8 +++---
Tests/GRDBTests/ValueObservationTests.swift | 10 +++----
Tests/SPM/PlainPackage/Package.swift | 4 +--
17 files changed, 50 insertions(+), 56 deletions(-)
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index 403fd74f9..d01661f93 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/groue/GRDB.swift.git', :tag => "v#{s.version}" }
s.module_name = 'GRDB'
- s.swift_versions = ['5.7']
+ s.swift_versions = ['5.10']
s.ios.deployment_target = '11.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift
index 7dd0525fc..34a9e7fde 100644
--- a/GRDB/Core/DatabasePool.swift
+++ b/GRDB/Core/DatabasePool.swift
@@ -644,8 +644,7 @@ extension DatabasePool: DatabaseReader {
// MARK: - WAL Snapshot Transactions
- // swiftlint:disable:next line_length
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
/// Returns a long-lived WAL snapshot transaction on a reader connection.
func walSnapshotTransaction() throws -> WALSnapshotTransaction {
guard let readerPool else {
@@ -870,8 +869,7 @@ extension DatabasePool {
purpose: "snapshot.\($databaseSnapshotCount.increment())")
}
- // swiftlint:disable:next line_length
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
/// Creates a database snapshot that allows concurrent accesses to an
/// unchanging database content, as it exists at the moment the snapshot
/// is created.
diff --git a/GRDB/Core/DatabaseSnapshotPool.swift b/GRDB/Core/DatabaseSnapshotPool.swift
index c32b0b1a2..35fec5a2d 100644
--- a/GRDB/Core/DatabaseSnapshotPool.swift
+++ b/GRDB/Core/DatabaseSnapshotPool.swift
@@ -1,5 +1,4 @@
-// swiftlint:disable:next line_length
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
/// A database connection that allows concurrent accesses to an unchanging
/// database content, as it existed at the moment the snapshot was created.
///
diff --git a/GRDB/Core/WALSnapshot.swift b/GRDB/Core/WALSnapshot.swift
index 4d50c67e0..b6122426e 100644
--- a/GRDB/Core/WALSnapshot.swift
+++ b/GRDB/Core/WALSnapshot.swift
@@ -1,5 +1,4 @@
-// swiftlint:disable:next line_length
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
/// An instance of WALSnapshot records the state of a WAL mode database for some
/// specific point in history.
///
@@ -15,8 +14,8 @@
/// With custom SQLite builds, it only works if `SQLITE_ENABLE_SNAPSHOT`
/// is defined.
///
-/// With system SQLite, it can only work when the SDK exposes the C apis and
-/// their availability, which means XCode 14 (identified with Swift 5.7).
+/// With system SQLite, it works because the SDK exposes the C apis and
+/// since XCode 14.
///
/// Yes, this is an awfully complex logic.
///
diff --git a/GRDB/Core/WALSnapshotTransaction.swift b/GRDB/Core/WALSnapshotTransaction.swift
index 5f56f1d2f..4340b67e4 100644
--- a/GRDB/Core/WALSnapshotTransaction.swift
+++ b/GRDB/Core/WALSnapshotTransaction.swift
@@ -1,5 +1,4 @@
-// swiftlint:disable:next line_length
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
/// A long-live read-only WAL transaction.
///
/// `WALSnapshotTransaction` **takes ownership** of its reader
diff --git a/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift b/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift
index a287a3767..a72c4aba8 100644
--- a/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift
+++ b/GRDB/ValueObservation/Observers/ValueConcurrentObserver.swift
@@ -273,8 +273,7 @@ extension ValueConcurrentObserver {
}
}
-// swiftlint:disable:next line_length
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
extension ValueConcurrentObserver {
/// Synchronously starts the observation, and returns the initial value.
///
diff --git a/Package.swift b/Package.swift
index a6f51175e..b31da24a7 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.7
+// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import Foundation
diff --git a/README.md b/README.md
index a5a40d8fc..0f54ad77c 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
**Latest release**: August 24, 2024 • [version 6.29.2](https://github.com/groue/GRDB.swift/tree/v6.29.2) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
-**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 5.7+ / Xcode 14+
+**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+
**Contact**:
diff --git a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift
index 2b1cf9394..f2b42977c 100644
--- a/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift
+++ b/Tests/GRDBCombineTests/DatabaseReaderReadPublisherTests.swift
@@ -44,7 +44,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabaseQueue(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshot() }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshotPool() }
#endif
}
@@ -149,7 +149,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
try Test(test).runAtTemporaryDatabasePath { try DatabaseQueue(path: $0) }
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0).makeSnapshot() }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0).makeSnapshotPool() }
#endif
}
@@ -189,7 +189,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabaseQueue(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshot() }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshotPool() }
#endif
}
@@ -229,7 +229,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabaseQueue(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshot() }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshotPool() }
#endif
}
@@ -270,7 +270,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabaseQueue(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)) }
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshot() }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try Test(test).runAtTemporaryDatabasePath { try setUp(DatabasePool(path: $0)).makeSnapshotPool() }
#endif
}
@@ -298,7 +298,7 @@ class DatabaseReaderReadPublisherTests : XCTestCase {
try Test(test).runAtTemporaryDatabasePath { try DatabaseQueue(path: $0) }
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0) }
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0).makeSnapshot() }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try Test(test).runAtTemporaryDatabasePath { try DatabasePool(path: $0).makeSnapshotPool() }
#endif
}
diff --git a/Tests/GRDBTests/DatabaseAbortedTransactionTests.swift b/Tests/GRDBTests/DatabaseAbortedTransactionTests.swift
index d6229e88d..1ac85a08f 100644
--- a/Tests/GRDBTests/DatabaseAbortedTransactionTests.swift
+++ b/Tests/GRDBTests/DatabaseAbortedTransactionTests.swift
@@ -40,7 +40,7 @@ class DatabaseAbortedTransactionTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -85,7 +85,7 @@ class DatabaseAbortedTransactionTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
diff --git a/Tests/GRDBTests/DatabaseConfigurationTests.swift b/Tests/GRDBTests/DatabaseConfigurationTests.swift
index 88fdb622b..079286e7e 100644
--- a/Tests/GRDBTests/DatabaseConfigurationTests.swift
+++ b/Tests/GRDBTests/DatabaseConfigurationTests.swift
@@ -27,7 +27,7 @@ class DatabaseConfigurationTests: GRDBTestCase {
try pool.makeSnapshot().read { _ in }
XCTAssertEqual(connectionCount, 5)
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try pool.makeSnapshotPool().read { _ in }
XCTAssertEqual(connectionCount, 6)
#endif
@@ -74,7 +74,7 @@ class DatabaseConfigurationTests: GRDBTestCase {
XCTFail("Expected TestError")
} catch is TestError { }
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
do {
error = TestError()
_ = try pool.makeSnapshotPool()
diff --git a/Tests/GRDBTests/DatabasePoolTests.swift b/Tests/GRDBTests/DatabasePoolTests.swift
index 7580b1a34..440af6b6b 100644
--- a/Tests/GRDBTests/DatabasePoolTests.swift
+++ b/Tests/GRDBTests/DatabasePoolTests.swift
@@ -41,7 +41,7 @@ class DatabasePoolTests: GRDBTestCase {
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-wal"))
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-shm"))
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
// A non-empty wal file makes sure ValueObservation can use wal snapshots.
// See
let walURL = URL(fileURLWithPath: dbPool.path + "-wal")
@@ -65,7 +65,7 @@ class DatabasePoolTests: GRDBTestCase {
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-wal"))
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-shm"))
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
// A non-empty wal file makes sure ValueObservation can use wal snapshots.
// See
let walURL = URL(fileURLWithPath: dbPool.path + "-wal")
@@ -91,7 +91,7 @@ class DatabasePoolTests: GRDBTestCase {
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-wal"))
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-shm"))
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
// A non-empty wal file makes sure ValueObservation can use wal snapshots.
// See
let walURL = URL(fileURLWithPath: dbPool.path + "-wal")
@@ -114,7 +114,7 @@ class DatabasePoolTests: GRDBTestCase {
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-wal"))
XCTAssertTrue(fm.fileExists(atPath: dbPool.path + "-shm"))
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
// A non-empty wal file makes sure ValueObservation can use wal snapshots.
// See
let walURL = URL(fileURLWithPath: dbPool.path + "-wal")
diff --git a/Tests/GRDBTests/DatabaseReaderTests.swift b/Tests/GRDBTests/DatabaseReaderTests.swift
index bf2d51c3f..d8702a60a 100644
--- a/Tests/GRDBTests/DatabaseReaderTests.swift
+++ b/Tests/GRDBTests/DatabaseReaderTests.swift
@@ -44,7 +44,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(setup(makeDatabaseQueue()))
try test(setup(makeDatabasePool()))
try test(setup(makeDatabasePool()).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(setup(makeDatabasePool()).makeSnapshotPool())
#endif
}
@@ -67,7 +67,7 @@ class DatabaseReaderTests : GRDBTestCase {
try await test(setup(makeDatabaseQueue()))
try await test(setup(makeDatabasePool()))
try await test(setup(makeDatabasePool()).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try await test(setup(makeDatabasePool()).makeSnapshotPool())
#endif
}
@@ -86,7 +86,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -106,7 +106,7 @@ class DatabaseReaderTests : GRDBTestCase {
try await test(makeDatabaseQueue())
try await test(makeDatabasePool())
try await test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try await test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -130,7 +130,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(setup(makeDatabaseQueue()))
try test(setup(makeDatabasePool()))
try test(setup(makeDatabasePool()).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(setup(makeDatabasePool()).makeSnapshotPool())
#endif
}
@@ -153,7 +153,7 @@ class DatabaseReaderTests : GRDBTestCase {
try await test(setup(makeDatabaseQueue()))
try await test(setup(makeDatabasePool()))
try await test(setup(makeDatabasePool()).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try await test(setup(makeDatabasePool()).makeSnapshotPool())
#endif
}
@@ -177,7 +177,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(setup(makeDatabaseQueue()))
try test(setup(makeDatabasePool()))
try test(setup(makeDatabasePool()).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(setup(makeDatabasePool()).makeSnapshotPool())
#endif
}
@@ -197,7 +197,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -244,7 +244,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -273,7 +273,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -293,7 +293,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -313,7 +313,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(makeDatabaseQueue())
try test(makeDatabasePool())
try test(makeDatabasePool().makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool().makeSnapshotPool())
#endif
}
@@ -340,7 +340,7 @@ class DatabaseReaderTests : GRDBTestCase {
try test(setup(makeDatabaseQueue(configuration: Configuration())))
try test(setup(makeDatabasePool(configuration: Configuration())))
try test(setup(makeDatabasePool(configuration: Configuration())).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(setup(makeDatabasePool(configuration: Configuration())).makeSnapshotPool())
#endif
}
diff --git a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift
index 6176865e8..99ae96abd 100644
--- a/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift
+++ b/Tests/GRDBTests/DatabaseSnapshotPoolTests.swift
@@ -1,4 +1,4 @@
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
import XCTest
import GRDB
diff --git a/Tests/GRDBTests/ValueObservationPrintTests.swift b/Tests/GRDBTests/ValueObservationPrintTests.swift
index 51f57f5b6..74e2450be 100644
--- a/Tests/GRDBTests/ValueObservationPrintTests.swift
+++ b/Tests/GRDBTests/ValueObservationPrintTests.swift
@@ -54,7 +54,7 @@ class ValueObservationPrintTests: GRDBTestCase {
try test(makeDatabaseQueue(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshotPool())
#endif
}
@@ -91,7 +91,7 @@ class ValueObservationPrintTests: GRDBTestCase {
try test(makeDatabaseQueue(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshotPool())
#endif
}
@@ -129,7 +129,7 @@ class ValueObservationPrintTests: GRDBTestCase {
try test(makeDatabaseQueue(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshotPool())
#endif
}
@@ -167,7 +167,7 @@ class ValueObservationPrintTests: GRDBTestCase {
try test(makeDatabaseQueue(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config))
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshot())
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
try test(makeDatabasePool(filename: "test", configuration: config).makeSnapshotPool())
#endif
}
diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift
index 7beeb4d6f..fe2ccee22 100644
--- a/Tests/GRDBTests/ValueObservationTests.swift
+++ b/Tests/GRDBTests/ValueObservationTests.swift
@@ -448,7 +448,7 @@ class ValueObservationTests: GRDBTestCase {
}
let expectedCounts: [Int]
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
// Optimization available
expectedCounts = [0, 1]
#else
@@ -498,7 +498,7 @@ class ValueObservationTests: GRDBTestCase {
}
let expectedCounts: [Int]
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
// Optimization available
expectedCounts = [0, 1]
#else
@@ -525,7 +525,7 @@ class ValueObservationTests: GRDBTestCase {
// MARK: - Snapshot Observation
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
func testDatabaseSnapshotPoolObservation() throws {
let dbPool = try makeDatabasePool()
try dbPool.write { try $0.execute(sql: "CREATE TABLE t(id INTEGER PRIMARY KEY AUTOINCREMENT)") }
@@ -1096,7 +1096,7 @@ class ValueObservationTests: GRDBTestCase {
}
let initialValueExpectation = self.expectation(description: "")
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
initialValueExpectation.assertForOverFulfill = true
#else
// ValueObservation on DatabasePool will notify the first value twice
@@ -1154,7 +1154,7 @@ class ValueObservationTests: GRDBTestCase {
}
let initialValueExpectation = self.expectation(description: "")
-#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER && (compiler(>=5.7.1) || !(os(macOS) || targetEnvironment(macCatalyst))))
+#if SQLITE_ENABLE_SNAPSHOT || (!GRDBCUSTOMSQLITE && !GRDBCIPHER)
initialValueExpectation.assertForOverFulfill = true
#else
// ValueObservation on DatabasePool will notify the first value twice
diff --git a/Tests/SPM/PlainPackage/Package.swift b/Tests/SPM/PlainPackage/Package.swift
index 3673c7afc..578a011bc 100644
--- a/Tests/SPM/PlainPackage/Package.swift
+++ b/Tests/SPM/PlainPackage/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.2
+// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
@@ -9,6 +9,6 @@ let package = Package(
.package(name: "GRDB", path: "../../.."),
],
targets: [
- .target(name: "SPM", dependencies: ["GRDB"]),
+ .executableTarget(name: "SPM", dependencies: ["GRDB"]),
]
)
From 29eb04c39a801000cb681a9e338a985e1511fe14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 15:04:22 +0200
Subject: [PATCH 016/331] [BREAKING] iOS 12+
---
GRDB.swift.podspec | 2 +-
GRDB/Core/Database+Statements.swift | 2 +-
GRDB/Core/Statement.swift | 2 +-
GRDB/Documentation.docc/Extension/TransactionObserver.md | 3 ---
GRDB/FTS/FTS5.swift | 2 +-
README.md | 2 +-
SQLiteCustom/GRDBDeploymentTarget.xcconfig | 2 +-
Support/GRDBDeploymentTarget.xcconfig | 2 +-
Tests/CocoaPods/GRDBiOS-framework/Podfile | 2 +-
.../GRDBiOS-framework/iOS.xcodeproj/project.pbxproj | 8 ++++----
Tests/CocoaPods/GRDBiOS-static/Podfile | 2 +-
.../GRDBiOS-static/iOS.xcodeproj/project.pbxproj | 4 ++--
12 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index d01661f93..724bdc838 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.module_name = 'GRDB'
s.swift_versions = ['5.10']
- s.ios.deployment_target = '11.0'
+ s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
s.tvos.deployment_target = '11.0'
diff --git a/GRDB/Core/Database+Statements.swift b/GRDB/Core/Database+Statements.swift
index 061c5b364..07ed9b5a8 100644
--- a/GRDB/Core/Database+Statements.swift
+++ b/GRDB/Core/Database+Statements.swift
@@ -538,7 +538,7 @@ struct StatementCache {
let statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
#else
let statement: Statement
- if #available(iOS 12, macOS 10.14, watchOS 5, *) { // SQLite 3.20+
+ if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+
statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
} else {
statement = try db.makeStatement(sql: sql)
diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift
index e1a90a108..6c99b4b92 100644
--- a/GRDB/Core/Statement.swift
+++ b/GRDB/Core/Statement.swift
@@ -137,7 +137,7 @@ public final class Statement {
database.sqliteConnection, statementStart, -1, prepFlags,
&sqliteStatement, statementEnd)
#else
- if #available(iOS 12, macOS 10.14, tvOS 12, watchOS 5, *) { // SQLite 3.20+
+ if #available(macOS 10.14, tvOS 12, watchOS 5, *) { // SQLite 3.20+
code = sqlite3_prepare_v3(
database.sqliteConnection, statementStart, -1, prepFlags,
&sqliteStatement, statementEnd)
diff --git a/GRDB/Documentation.docc/Extension/TransactionObserver.md b/GRDB/Documentation.docc/Extension/TransactionObserver.md
index 9815e0852..72acd5e51 100644
--- a/GRDB/Documentation.docc/Extension/TransactionObserver.md
+++ b/GRDB/Documentation.docc/Extension/TransactionObserver.md
@@ -205,11 +205,8 @@ This extra API can be activated in two ways:
1. Use the GRDB.swift CocoaPod with a custom compilation option, as below.
- It uses the system SQLite, which is compiled with `SQLITE_ENABLE_PREUPDATE_HOOK` support, but only on iOS 11.0+ (we don't know the minimum version of macOS, tvOS, watchOS):
-
```ruby
pod 'GRDB.swift'
- platform :ios, '11.0' # or above
post_install do |installer|
installer.pods_project.targets.select { |target| target.name == "GRDB.swift" }.each do |target|
diff --git a/GRDB/FTS/FTS5.swift b/GRDB/FTS/FTS5.swift
index a18da5a3f..bca5c4e5a 100644
--- a/GRDB/FTS/FTS5.swift
+++ b/GRDB/FTS/FTS5.swift
@@ -121,7 +121,7 @@ public struct FTS5 {
return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer)
#else
// GRDB is linked against the system SQLite.
- if #available(iOS 12, macOS 10.14, tvOS 12, watchOS 5, *) { // SQLite 3.20+
+ if #available(macOS 10.14, tvOS 12, watchOS 5, *) { // SQLite 3.20+
return api_v2(db, sqlite3_prepare_v3, sqlite3_bind_pointer)
} else {
return api_v1(db)
diff --git a/README.md b/README.md
index 0f54ad77c..1a8f79072 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
**Latest release**: August 24, 2024 • [version 6.29.2](https://github.com/groue/GRDB.swift/tree/v6.29.2) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
-**Requirements**: iOS 11.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+
+**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+
**Contact**:
diff --git a/SQLiteCustom/GRDBDeploymentTarget.xcconfig b/SQLiteCustom/GRDBDeploymentTarget.xcconfig
index 904204125..a9ba8e889 100644
--- a/SQLiteCustom/GRDBDeploymentTarget.xcconfig
+++ b/SQLiteCustom/GRDBDeploymentTarget.xcconfig
@@ -1,4 +1,4 @@
-IPHONEOS_DEPLOYMENT_TARGET = 11.0
+IPHONEOS_DEPLOYMENT_TARGET = 12.0
MACOSX_DEPLOYMENT_TARGET = 10.13
TVOS_DEPLOYMENT_TARGET = 11.0
WATCHOS_DEPLOYMENT_TARGET = 4.0
diff --git a/Support/GRDBDeploymentTarget.xcconfig b/Support/GRDBDeploymentTarget.xcconfig
index 753467b40..4e708e1de 100644
--- a/Support/GRDBDeploymentTarget.xcconfig
+++ b/Support/GRDBDeploymentTarget.xcconfig
@@ -1,4 +1,4 @@
-IPHONEOS_DEPLOYMENT_TARGET = 11.0
+IPHONEOS_DEPLOYMENT_TARGET = 12.0
MACOSX_DEPLOYMENT_TARGET = 10.13
TVOS_DEPLOYMENT_TARGET = 11.0
WATCHOS_DEPLOYMENT_TARGET = 4.0
diff --git a/Tests/CocoaPods/GRDBiOS-framework/Podfile b/Tests/CocoaPods/GRDBiOS-framework/Podfile
index 8a4c9e93a..2c4299502 100644
--- a/Tests/CocoaPods/GRDBiOS-framework/Podfile
+++ b/Tests/CocoaPods/GRDBiOS-framework/Podfile
@@ -1,6 +1,6 @@
use_frameworks!
target 'iOS'
-platform :ios, '11.0'
+platform :ios, '12.0'
pod 'GRDB.swift', :path => '../../..'
post_install do |installer|
diff --git a/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj b/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj
index 4de5afc20..7a961bd71 100644
--- a/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj
+++ b/Tests/CocoaPods/GRDBiOS-framework/iOS.xcodeproj/project.pbxproj
@@ -251,7 +251,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -301,7 +301,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
@@ -318,7 +318,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBTest;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -335,7 +335,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = Info.plist;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBTest;
PRODUCT_NAME = "$(TARGET_NAME)";
diff --git a/Tests/CocoaPods/GRDBiOS-static/Podfile b/Tests/CocoaPods/GRDBiOS-static/Podfile
index 94614c25b..3746f208f 100644
--- a/Tests/CocoaPods/GRDBiOS-static/Podfile
+++ b/Tests/CocoaPods/GRDBiOS-static/Podfile
@@ -1,5 +1,5 @@
target 'iOS'
-platform :ios, '11.0'
+platform :ios, '12.0'
pod 'GRDB.swift', :path => '../../..'
post_install do |installer|
diff --git a/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj b/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj
index 625554512..3ee741cb0 100644
--- a/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj
+++ b/Tests/CocoaPods/GRDBiOS-static/iOS.xcodeproj/project.pbxproj
@@ -232,7 +232,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -282,7 +282,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
From 509cbb9881a875bdbd5983c7b4fb85e0a8c83894 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 15:06:57 +0200
Subject: [PATCH 017/331] [BREAKING] tvOS 12+
---
GRDB.swift.podspec | 2 +-
README.md | 2 +-
SQLiteCustom/GRDBDeploymentTarget.xcconfig | 2 +-
Support/GRDBDeploymentTarget.xcconfig | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index 724bdc838..285b23b35 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
- s.tvos.deployment_target = '11.0'
+ s.tvos.deployment_target = '12.0'
s.default_subspec = 'standard'
s.subspec 'standard' do |ss|
diff --git a/README.md b/README.md
index 1a8f79072..38f792764 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
**Latest release**: August 24, 2024 • [version 6.29.2](https://github.com/groue/GRDB.swift/tree/v6.29.2) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 5 to GRDB 6](Documentation/GRDB6MigrationGuide.md)
-**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 11.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+
+**Requirements**: iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 4.0+ • SQLite 3.19.3+ • Swift 6+ / Xcode 16+
**Contact**:
diff --git a/SQLiteCustom/GRDBDeploymentTarget.xcconfig b/SQLiteCustom/GRDBDeploymentTarget.xcconfig
index a9ba8e889..db069babc 100644
--- a/SQLiteCustom/GRDBDeploymentTarget.xcconfig
+++ b/SQLiteCustom/GRDBDeploymentTarget.xcconfig
@@ -1,4 +1,4 @@
IPHONEOS_DEPLOYMENT_TARGET = 12.0
MACOSX_DEPLOYMENT_TARGET = 10.13
-TVOS_DEPLOYMENT_TARGET = 11.0
+TVOS_DEPLOYMENT_TARGET = 12.0
WATCHOS_DEPLOYMENT_TARGET = 4.0
diff --git a/Support/GRDBDeploymentTarget.xcconfig b/Support/GRDBDeploymentTarget.xcconfig
index 4e708e1de..16b2393c4 100644
--- a/Support/GRDBDeploymentTarget.xcconfig
+++ b/Support/GRDBDeploymentTarget.xcconfig
@@ -1,6 +1,6 @@
IPHONEOS_DEPLOYMENT_TARGET = 12.0
MACOSX_DEPLOYMENT_TARGET = 10.13
-TVOS_DEPLOYMENT_TARGET = 11.0
+TVOS_DEPLOYMENT_TARGET = 12.0
WATCHOS_DEPLOYMENT_TARGET = 4.0
OTHER_SWIFT_FLAGS = $(inherited) -D SQLITE_ENABLE_FTS5
From 79cb862478915bc2a683f9a545b9a07d6833bef4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gwendal=20Roue=CC=81?=
Date: Sat, 24 Aug 2024 15:14:54 +0200
Subject: [PATCH 018/331] [BREAKING] watchOS 7+
Rationale: https://github.com/groue/GRDB.swift/issues/1472#issuecomment-1960696836
---
GRDB.swift.podspec | 2 +-
GRDB/Core/Database+Statements.swift | 2 +-
GRDB/Core/DatabasePublishers.swift | 2 +-
GRDB/Core/DatabaseReader.swift | 10 +++----
GRDB/Core/DatabaseRegionObservation.swift | 6 ++---
GRDB/Core/DatabaseWriter.swift | 24 ++++++++---------
GRDB/Core/Statement.swift | 2 +-
GRDB/Dump/DumpFormats/JSONDumpFormat.swift | 2 +-
GRDB/FTS/FTS3.swift | 2 +-
GRDB/FTS/FTS5.swift | 4 +--
GRDB/Fixits.swift | 6 ++---
GRDB/Migration/DatabaseMigrator.swift | 4 +--
.../Request/QueryInterfaceRequest.swift | 2 +-
.../Request/RequestProtocols.swift | 2 +-
GRDB/QueryInterface/SQL/SQLExpression.swift | 6 ++---
GRDB/QueryInterface/SQL/SQLFunctions.swift | 10 +++----
GRDB/QueryInterface/SQL/Table.swift | 6 ++---
.../Schema/TableAlteration.swift | 2 +-
.../TableRecord+QueryInterfaceRequest.swift | 2 +-
GRDB/Record/FetchableRecord+TableRecord.swift | 4 +--
GRDB/Record/TableRecord.swift | 6 ++---
GRDB/Utils/OnDemandFuture.swift | 4 +--
GRDB/Utils/ReceiveValuesOn.swift | 6 ++---
.../SharedValueObservation.swift | 4 +--
GRDB/ValueObservation/ValueObservation.swift | 8 +++---
README.md | 2 +-
SQLiteCustom/GRDBDeploymentTarget.xcconfig | 2 +-
Support/GRDBDeploymentTarget.xcconfig | 2 +-
.../AvailableElements.swift | 2 +-
.../PublisherExpectations/Finished.swift | 2 +-
.../PublisherExpectations/Inverted.swift | 2 +-
.../PublisherExpectations/Map.swift | 4 +--
.../PublisherExpectations/Next.swift | 2 +-
.../PublisherExpectations/NextOne.swift | 2 +-
.../PublisherExpectations/Prefix.swift | 2 +-
.../PublisherExpectations/Recording.swift | 2 +-
Tests/CombineExpectations/Recorder.swift | 8 +++---
.../DatabaseReaderReadPublisherTests.swift | 12 ++++-----
...abaseRegionObservationPublisherTests.swift | 4 +--
.../DatabaseWriterWritePublisherTests.swift | 26 +++++++++----------
Tests/GRDBCombineTests/Support.swift | 6 ++---
.../ValueObservationPublisherTests.swift | 24 ++++++++---------
.../DatabaseDataEncodingStrategyTests.swift | 8 +++---
.../DatabaseDateEncodingStrategyTests.swift | 8 +++---
Tests/GRDBTests/DatabaseDumpTests.swift | 2 +-
Tests/GRDBTests/DatabaseMigratorTests.swift | 12 ++++-----
Tests/GRDBTests/DatabaseReaderTests.swift | 6 ++---
.../DatabaseRegionObservationTests.swift | 2 +-
.../GRDBTests/DatabaseSnapshotPoolTests.swift | 2 +-
.../DatabaseUUIDEncodingStrategyTests.swift | 8 +++---
Tests/GRDBTests/DatabaseWriterTests.swift | 16 ++++++------
Tests/GRDBTests/FTS3TableBuilderTests.swift | 2 +-
Tests/GRDBTests/FTS5TableBuilderTests.swift | 2 +-
Tests/GRDBTests/JoinSupportTests.swift | 6 ++---
.../QueryInterfaceExpressionsTests.swift | 10 +++----
.../QueryInterfaceRequestTests.swift | 8 +++---
...imalNonOptionalPrimaryKeySingleTests.swift | 20 +++++++-------
.../RecordMinimalPrimaryKeyRowIDTests.swift | 20 +++++++-------
.../RecordMinimalPrimaryKeySingleTests.swift | 20 +++++++-------
.../RecordPrimaryKeyHiddenRowIDTests.swift | 20 +++++++-------
.../SharedValueObservationTests.swift | 10 +++----
Tests/GRDBTests/TableDefinitionTests.swift | 4 +--
...bleRecord+QueryInterfaceRequestTests.swift | 4 +--
Tests/GRDBTests/TableRecordDeleteTests.swift | 18 ++++++-------
Tests/GRDBTests/TableRecordUpdateTests.swift | 4 +--
Tests/GRDBTests/TableTests.swift | 12 ++++-----
Tests/GRDBTests/ValueObservationTests.swift | 12 ++++-----
67 files changed, 234 insertions(+), 234 deletions(-)
diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec
index 285b23b35..932a8867e 100644
--- a/GRDB.swift.podspec
+++ b/GRDB.swift.podspec
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.swift_versions = ['5.10']
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
- s.watchos.deployment_target = '4.0'
+ s.watchos.deployment_target = '7.0'
s.tvos.deployment_target = '12.0'
s.default_subspec = 'standard'
diff --git a/GRDB/Core/Database+Statements.swift b/GRDB/Core/Database+Statements.swift
index 07ed9b5a8..9159140f2 100644
--- a/GRDB/Core/Database+Statements.swift
+++ b/GRDB/Core/Database+Statements.swift
@@ -538,7 +538,7 @@ struct StatementCache {
let statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
#else
let statement: Statement
- if #available(macOS 10.14, watchOS 5, *) { // SQLite 3.20+
+ if #available(macOS 10.14, *) { // SQLite 3.20+
statement = try db.makeStatement(sql: sql, prepFlags: CUnsignedInt(SQLITE_PREPARE_PERSISTENT))
} else {
statement = try db.makeStatement(sql: sql)
diff --git a/GRDB/Core/DatabasePublishers.swift b/GRDB/Core/DatabasePublishers.swift
index 8f8054953..88c0c4806 100644
--- a/GRDB/Core/DatabasePublishers.swift
+++ b/GRDB/Core/DatabasePublishers.swift
@@ -1,5 +1,5 @@
#if canImport(Combine)
/// A namespace for database Combine publishers.
-@available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
+@available(iOS 13, macOS 10.15, tvOS 13, *)
public enum DatabasePublishers { }
#endif
diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift
index 5fac0df44..ca694be0d 100644
--- a/GRDB/Core/DatabaseReader.swift
+++ b/GRDB/Core/DatabaseReader.swift
@@ -458,7 +458,7 @@ extension DatabaseReader {
/// - parameter value: A closure which accesses the database.
/// - throws: The error thrown by `value`, or any ``DatabaseError`` that
/// would happen while establishing the database access.
- @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
+ @available(iOS 13, macOS 10.15, tvOS 13, *)
public func read(_ value: @Sendable @escaping (Database) throws -> T) async throws -> T {
try await withUnsafeThrowingContinuation { continuation in
asyncRead { result in
@@ -504,7 +504,7 @@ extension DatabaseReader {
/// - parameter value: A closure which accesses the database.
/// - throws: The error thrown by `value`, or any ``DatabaseError`` that
/// would happen while establishing the database access.
- @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
+ @available(iOS 13, macOS 10.15, tvOS 13, *)
public func unsafeRead(_ value: @Sendable @escaping (Database) throws -> T) async throws -> T {
try await withUnsafeThrowingContinuation { continuation in
asyncUnsafeRead { result in
@@ -549,7 +549,7 @@ extension DatabaseReader {
///
/// - parameter scheduler: A Combine Scheduler.
/// - parameter value: A closure which accesses the database.
- @available(iOS 13, macOS 10.15, tvOS 13, watchOS 6, *)
+ @available(iOS 13, macOS 10.15, tvOS 13, *)
public func readPublisher