Skip to content

Commit edc1d64

Browse files
committed
[BREAKING] Bump minimum Swift version to 6.1
1 parent ab09078 commit edc1d64

22 files changed

+14
-107
lines changed

.spi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ version: 1
22
builder:
33
configs:
44
- documentation_targets: [GRDB]
5-
swift_version: 6.0
5+
swift_version: 6.1

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemo;
383383
PRODUCT_NAME = "$(TARGET_NAME)";
384384
SWIFT_EMIT_LOC_STRINGS = YES;
385-
SWIFT_VERSION = 6.0;
385+
SWIFT_VERSION = 6.1;
386386
TARGETED_DEVICE_FAMILY = "1,2";
387387
};
388388
name = Debug;
@@ -411,7 +411,7 @@
411411
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemo;
412412
PRODUCT_NAME = "$(TARGET_NAME)";
413413
SWIFT_EMIT_LOC_STRINGS = YES;
414-
SWIFT_VERSION = 6.0;
414+
SWIFT_VERSION = 6.1;
415415
TARGETED_DEVICE_FAMILY = "1,2";
416416
};
417417
name = Release;
@@ -427,7 +427,7 @@
427427
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoTests;
428428
PRODUCT_NAME = "$(TARGET_NAME)";
429429
SWIFT_EMIT_LOC_STRINGS = NO;
430-
SWIFT_VERSION = 6.0;
430+
SWIFT_VERSION = 6.1;
431431
TARGETED_DEVICE_FAMILY = "1,2";
432432
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/GRDBDemo";
433433
};
@@ -444,7 +444,7 @@
444444
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoTests;
445445
PRODUCT_NAME = "$(TARGET_NAME)";
446446
SWIFT_EMIT_LOC_STRINGS = NO;
447-
SWIFT_VERSION = 6.0;
447+
SWIFT_VERSION = 6.1;
448448
TARGETED_DEVICE_FAMILY = "1,2";
449449
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/GRDBDemo";
450450
};

GRDB.swift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
99
s.source = { :git => 'https://github.com/groue/GRDB.swift.git', :tag => "v#{s.version}" }
1010
s.module_name = 'GRDB'
1111

12-
s.swift_versions = ['6']
12+
s.swift_versions = ['6.1']
1313
s.ios.deployment_target = '13.0'
1414
s.osx.deployment_target = '10.15'
1515
s.watchos.deployment_target = '7.0'

GRDB/Record/FetchableRecord+Decodable.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,20 +519,16 @@ private struct SingleValueRowDecoder<R: FetchableRecord>: SingleValueDecodingCon
519519
func decode(_ type: Int16.Type) throws -> Int16 { try columnDecoder.decode(type) }
520520
func decode(_ type: Int32.Type) throws -> Int32 { try columnDecoder.decode(type) }
521521
func decode(_ type: Int64.Type) throws -> Int64 { try columnDecoder.decode(type) }
522-
#if compiler(>=6)
523522
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
524523
func decode(_ type: Int128.Type) throws -> Int128 { try columnDecoder.decode(type) }
525-
#endif
526524
func decode(_ type: UInt.Type) throws -> UInt { try columnDecoder.decode(type) }
527525
func decode(_ type: UInt8.Type) throws -> UInt8 { try columnDecoder.decode(type) }
528526
func decode(_ type: UInt16.Type) throws -> UInt16 { try columnDecoder.decode(type) }
529527
func decode(_ type: UInt32.Type) throws -> UInt32 { try columnDecoder.decode(type) }
530528
func decode(_ type: UInt64.Type) throws -> UInt64 { try columnDecoder.decode(type) }
531-
#if compiler(>=6)
532529
@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *)
533530
func decode(_ type: UInt128.Type) throws -> UInt128 { try columnDecoder.decode(type) }
534-
#endif
535-
531+
536532
func decode<T>(_ type: T.Type) throws -> T where T: Decodable {
537533
if let type = T.self as? any FetchableRecord.Type {
538534
// Prefer FetchableRecord decoding over Decodable.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:6.0
1+
// swift-tools-version:6.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import Foundation

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</p>
1111

1212
<p align="center">
13-
<a href="https://developer.apple.com/swift/"><img alt="Swift 6" src="https://img.shields.io/badge/swift-6-orange.svg?style=flat"></a>
13+
<a href="https://developer.apple.com/swift/"><img alt="Swift 6.1" src="https://img.shields.io/badge/swift-6.1-orange.svg?style=flat"></a>
1414
<a href="https://github.com/groue/GRDB.swift/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/groue/GRDB.swift.svg?maxAge=2592000"></a>
1515
<a href="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml"><img alt="CI Status" src="https://github.com/groue/GRDB.swift/actions/workflows/CI.yml/badge.svg?branch=master"></a>
1616
</p>
@@ -27,7 +27,7 @@
2727

2828
**Latest release**: October 2, 2025 • [version 7.8.0](https://github.com/groue/GRDB.swift/tree/v7.8.0) • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 6 to GRDB 7](Documentation/GRDB7MigrationGuide.md)
2929

30-
**Requirements**: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ &bull; SQLite 3.20.0+ &bull; Swift 6+ / Xcode 16+
30+
**Requirements**: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ &bull; SQLite 3.20.0+ &bull; Swift 6.1+ / Xcode 16.3+
3131

3232
**Contact**:
3333

SQLiteCustom/GRDB.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ OTHER_CFLAGS = -DUSING_BUILTIN_SQLITE -DGRDBCUSTOMSQLITE $(CUSTOM_SQLLIBRARY_CFL
1313
GCC_PREPROCESSOR_DEFINITIONS = "GRDBCUSTOMSQLITE=1"
1414
OTHER_SWIFT_FLAGS = -D USING_BUILTIN_SQLITE -D GRDBCUSTOMSQLITE $(CUSTOM_OTHER_SWIFT_FLAGS)
1515
HEADER_SEARCH_PATHS = $(SRCROOT)/SQLiteCustom/src
16-
SWIFT_VERSION = 6.0
16+
SWIFT_VERSION = 6.1

Support/GRDB.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ INFOPLIST_FILE = Support/Info.plist
33
PRODUCT_NAME = GRDB
44
PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.$(PRODUCT_NAME:rfc1034identifier)
55
MODULEMAP_FILE = $(SRCROOT)/Support/module.modulemap
6-
SWIFT_VERSION = 6.0
6+
SWIFT_VERSION = 6.1
77

88
// Slow compilation hunt:
99
// OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -warn-long-expression-type-checking=100 -Xfrontend -warn-long-function-bodies=100

Tests/GRDBTests/AssociationAggregateTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ class AssociationAggregateTests: GRDBTestCase {
122122
}
123123
}
124124

125-
#if compiler(>=6.1)
126125
func testAggregateWithGroup_swift61() throws {
127126
let dbQueue = try makeDatabaseQueue()
128127
try dbQueue.read { db in
@@ -139,7 +138,6 @@ class AssociationAggregateTests: GRDBTestCase {
139138
""")
140139
}
141140
}
142-
#endif
143141

144142
func testAnnotatedWithHasManyDefaultAverage() throws {
145143
let dbQueue = try makeDatabaseQueue()
@@ -296,7 +294,6 @@ class AssociationAggregateTests: GRDBTestCase {
296294
}
297295
}
298296

299-
#if compiler(>=6.1)
300297
func testAnnotatedWithHasManyDefaultMax_Swift61() throws {
301298
let dbQueue = try makeDatabaseQueue()
302299
try dbQueue.read { db in
@@ -333,7 +330,6 @@ class AssociationAggregateTests: GRDBTestCase {
333330
XCTAssertEqual(teamInfos[3].maxPlayerScore, 0)
334331
}
335332
}
336-
#endif
337333

338334
func testAnnotatedWithHasManyDefaultMaxJoiningRequired() throws {
339335
// It is important to have an explicit test for this technique because

Tests/GRDBTests/AssociationBelongsToDecodableRecordTests.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ private extension QueryInterfaceRequest<Player> {
5353
.order { [teamAlias[Team.Columns.name], $0.name] }
5454
}
5555

56-
#if compiler(>=6.1)
5756
func orderedByTeamName_swift61() -> QueryInterfaceRequest<Player> {
5857
let teamAlias = TableAlias<Team>()
5958
return self
6059
.joining(optional: PlayerWithOptionalTeam.team.aliased(teamAlias))
6160
.order { [teamAlias.name, $0.name] }
6261
}
63-
#endif
6462
}
6563

6664
/// Test support for Decodable records
@@ -190,7 +188,6 @@ class AssociationBelongsToDecodableRecordTests: GRDBTestCase {
190188
XCTAssertEqual(records[0].team.name, "Reds")
191189
}
192190

193-
#if compiler(>=6.1)
194191
func testRequestRefining_swift61() throws {
195192
let dbQueue = try makeDatabaseQueue()
196193
let request = Player
@@ -212,5 +209,4 @@ class AssociationBelongsToDecodableRecordTests: GRDBTestCase {
212209
XCTAssertEqual(records[0].team.id, 1)
213210
XCTAssertEqual(records[0].team.name, "Reds")
214211
}
215-
#endif
216212
}

0 commit comments

Comments
 (0)