Skip to content

Commit 7eea8cc

Browse files
authored
Merge pull request #1813 from groue/dev/SendableMetaType
Support for Xcode 26
2 parents 4cfa692 + 6a25b35 commit 7eea8cc

File tree

20 files changed

+64
-25
lines changed

20 files changed

+64
-25
lines changed

Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
attributes = {
159159
BuildIndependentTargetsInParallel = 1;
160160
LastSwiftUpdateCheck = 1600;
161-
LastUpgradeCheck = 1600;
161+
LastUpgradeCheck = 2600;
162162
TargetAttributes = {
163163
56CFC6432C9F1DC9000B5023 = {
164164
CreatedOnToolsVersion = 16.0;
@@ -293,6 +293,7 @@
293293
MTL_FAST_MATH = YES;
294294
ONLY_ACTIVE_ARCH = YES;
295295
SDKROOT = iphoneos;
296+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
296297
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
297298
SWIFT_EMIT_LOC_STRINGS = YES;
298299
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -350,6 +351,7 @@
350351
MTL_ENABLE_DEBUG_INFO = NO;
351352
MTL_FAST_MATH = YES;
352353
SDKROOT = iphoneos;
354+
STRING_CATALOG_GENERATE_SYMBOLS = YES;
353355
SWIFT_COMPILATION_MODE = wholemodule;
354356
SWIFT_EMIT_LOC_STRINGS = YES;
355357
VALIDATE_PRODUCT = YES;

Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/xcshareddata/xcschemes/GRDBDemo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1600"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"

Documentation/DemoApps/GRDBDemo/GRDBDemo/Views/PlayerListModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import GRDB
5656

5757
// Start observing the database.
5858
// Previous observation, if any, is cancelled.
59-
cancellable = observation.start(in: appDatabase.reader) { error in
59+
cancellable = observation.start(in: appDatabase.reader, scheduling: .immediate) { error in
6060
// Handle error
6161
} onChange: { [unowned self] players in
6262
self.players = players

GRDB.xcodeproj/project.pbxproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,8 +1842,9 @@
18421842
DC3773EA19C8CBB3004FCF85 /* Project object */ = {
18431843
isa = PBXProject;
18441844
attributes = {
1845+
BuildIndependentTargetsInParallel = YES;
18451846
LastSwiftUpdateCheck = 0730;
1846-
LastUpgradeCheck = 1400;
1847+
LastUpgradeCheck = 2600;
18471848
ORGANIZATIONNAME = "Gwendal Roué";
18481849
TargetAttributes = {
18491850
56E5D7F81B4D422D00430942 = {
@@ -2539,13 +2540,15 @@
25392540
DYLIB_COMPATIBILITY_VERSION = 1;
25402541
DYLIB_CURRENT_VERSION = 1;
25412542
DYLIB_INSTALL_NAME_BASE = "@rpath";
2543+
ENABLE_MODULE_VERIFIER = YES;
25422544
INFOPLIST_FILE = Support/Info.plist;
25432545
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
25442546
LD_RUNPATH_SEARCH_PATHS = (
25452547
"$(inherited)",
25462548
"@executable_path/Frameworks",
25472549
"@loader_path/Frameworks",
25482550
);
2551+
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
25492552
SKIP_INSTALL = YES;
25502553
SUPPORTED_PLATFORMS = "watchsimulator watchos macosx iphonesimulator iphoneos driverkit appletvsimulator appletvos";
25512554
SUPPORTS_MACCATALYST = YES;
@@ -2570,13 +2573,15 @@
25702573
DYLIB_COMPATIBILITY_VERSION = 1;
25712574
DYLIB_CURRENT_VERSION = 1;
25722575
DYLIB_INSTALL_NAME_BASE = "@rpath";
2576+
ENABLE_MODULE_VERIFIER = YES;
25732577
INFOPLIST_FILE = Support/Info.plist;
25742578
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
25752579
LD_RUNPATH_SEARCH_PATHS = (
25762580
"$(inherited)",
25772581
"@executable_path/Frameworks",
25782582
"@loader_path/Frameworks",
25792583
);
2584+
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11";
25802585
SKIP_INSTALL = YES;
25812586
SUPPORTED_PLATFORMS = "watchsimulator watchos macosx iphonesimulator iphoneos driverkit appletvsimulator appletvos";
25822587
SUPPORTS_MACCATALYST = YES;

GRDB.xcodeproj/xcshareddata/xcschemes/GRDB.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1400"
3+
LastUpgradeVersion = "2600"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

GRDB/Core/DatabaseFunction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public final class DatabaseFunction: Identifiable, Sendable {
492492
/// try Int.fetchOne(db, sql: "SELECT mysum(i) FROM test")! // 3
493493
/// }
494494
/// ```
495-
public protocol DatabaseAggregate {
495+
public protocol DatabaseAggregate: GRDBSendableMetatype {
496496
/// Creates an aggregate.
497497
///
498498
/// A new instance is created for each aggregation.

GRDB/Core/DatabaseRegionObservation.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,11 @@ extension DatabasePublishers {
201201
self.observation = observation
202202
}
203203

204-
public func receive<S>(subscriber: S) where S: Subscriber, Failure == S.Failure, Output == S.Input {
204+
public func receive<S>(subscriber: S)
205+
where S: Subscriber & GRDBSendableMetatype,
206+
Failure == S.Failure,
207+
Output == S.Input
208+
{
205209
let subscription = DatabaseRegionSubscription(
206210
writer: writer,
207211
observation: observation,
@@ -212,7 +216,7 @@ extension DatabasePublishers {
212216

213217
private class DatabaseRegionSubscription<Downstream>:
214218
Subscription, @unchecked Sendable
215-
where Downstream: Subscriber,
219+
where Downstream: Subscriber & GRDBSendableMetatype,
216220
Downstream.Failure == Error,
217221
Downstream.Input == Database
218222
{

GRDB/Documentation.docc/SwiftConcurrency.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,5 +229,11 @@ Task {
229229
}
230230
```
231231

232+
## Topics
233+
234+
### Supporting Types
235+
236+
- ``GRDBSendableMetatype``
237+
232238
[demo apps]: https://github.com/groue/GRDB.swift/tree/master/Documentation/DemoApps
233239
[Migrating to Swift 6]: https://www.swift.org/migration/documentation/migrationguide/

GRDB/QueryInterface/Request/QueryInterfaceRequest.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,13 @@ extension QueryInterfaceRequest: SelectionRequest {
362362
public func selectID() -> QueryInterfaceRequest<RowDecoder.ID>
363363
where RowDecoder: Identifiable
364364
{
365-
selectWhenConnected { db in
366-
let primaryKey = try db.primaryKey(self.databaseTableName)
365+
let databaseTableName = self.databaseTableName
366+
367+
return selectWhenConnected { db in
368+
let primaryKey = try db.primaryKey(databaseTableName)
367369
GRDBPrecondition(
368370
primaryKey.columns.count == 1,
369-
"selectID requires a single-column primary key in the table \(self.databaseTableName)")
371+
"selectID requires a single-column primary key in the table \(databaseTableName)")
370372
return [Column(primaryKey.columns[0])]
371373
}.asRequest(of: RowDecoder.ID.self)
372374
}

GRDB/Record/EncodableRecord.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Foundation // For JSONEncoder
3939
/// - ``databaseChanges(from:)``
4040
/// - ``databaseChanges(modify:)``
4141
/// - ``databaseEquals(_:)``
42-
public protocol EncodableRecord {
42+
public protocol EncodableRecord: GRDBSendableMetatype {
4343
/// Encodes the record into the provided persistence container.
4444
///
4545
/// In your implementation of this method, store in the `container` argument

0 commit comments

Comments
 (0)