From edc1d646f0181fe1d4fd5d230ac4cafdeb5acbe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sat, 4 Oct 2025 12:58:08 +0200 Subject: [PATCH 1/8] [BREAKING] Bump minimum Swift version to 6.1 --- .spi.yml | 2 +- .../GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj | 8 ++++---- GRDB.swift.podspec | 2 +- GRDB/Record/FetchableRecord+Decodable.swift | 6 +----- Package.swift | 2 +- README.md | 4 ++-- SQLiteCustom/GRDB.xcconfig | 2 +- Support/GRDB.xcconfig | 2 +- Tests/GRDBTests/AssociationAggregateTests.swift | 4 ---- ...ssociationBelongsToDecodableRecordTests.swift | 4 ---- .../AssociationBelongsToSQLDerivationTests.swift | 6 ------ .../AssociationHasOneSQLDerivationTests.swift | 4 ---- ...ociationHasOneThroughSQLDerivationTests.swift | 4 ---- .../AssociationTableAliasTestsSQLTests.swift | 2 -- Tests/GRDBTests/CommonTableExpressionTests.swift | 16 ---------------- Tests/GRDBTests/GRDBTestCase.swift | 5 ----- .../QueryInterfaceExpressionsTests.swift | 2 -- Tests/GRDBTests/QueryInterfaceRequestTests.swift | 16 ---------------- .../TableRecord+QueryInterfaceRequestTests.swift | 14 -------------- Tests/GRDBTests/ValueObservationTests.swift | 12 ------------ Tests/SPM/PlainPackage/Package.swift | 2 +- Tests/Swift6Migration/LanguageMode6.xcconfig | 2 +- 22 files changed, 14 insertions(+), 107 deletions(-) diff --git a/.spi.yml b/.spi.yml index 672a6aac06..d72ab58e99 100644 --- a/.spi.yml +++ b/.spi.yml @@ -2,4 +2,4 @@ version: 1 builder: configs: - documentation_targets: [GRDB] - swift_version: 6.0 + swift_version: 6.1 diff --git a/Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj b/Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj index 6edc319733..599df31db1 100644 --- a/Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj +++ b/Documentation/DemoApps/GRDBDemo/GRDBDemo.xcodeproj/project.pbxproj @@ -382,7 +382,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 6.1; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -411,7 +411,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 6.1; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -427,7 +427,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 6.1; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/GRDBDemo"; }; @@ -444,7 +444,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.GRDBDemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 6.0; + SWIFT_VERSION = 6.1; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GRDBDemo.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/GRDBDemo"; }; diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index 70065f8228..a58b8eea32 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 = ['6'] + s.swift_versions = ['6.1'] s.ios.deployment_target = '13.0' s.osx.deployment_target = '10.15' s.watchos.deployment_target = '7.0' diff --git a/GRDB/Record/FetchableRecord+Decodable.swift b/GRDB/Record/FetchableRecord+Decodable.swift index 3edf3611ce..99c2c0475f 100644 --- a/GRDB/Record/FetchableRecord+Decodable.swift +++ b/GRDB/Record/FetchableRecord+Decodable.swift @@ -519,20 +519,16 @@ private struct SingleValueRowDecoder: SingleValueDecodingCon func decode(_ type: Int16.Type) throws -> Int16 { try columnDecoder.decode(type) } func decode(_ type: Int32.Type) throws -> Int32 { try columnDecoder.decode(type) } func decode(_ type: Int64.Type) throws -> Int64 { try columnDecoder.decode(type) } -#if compiler(>=6) @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) func decode(_ type: Int128.Type) throws -> Int128 { try columnDecoder.decode(type) } -#endif func decode(_ type: UInt.Type) throws -> UInt { try columnDecoder.decode(type) } func decode(_ type: UInt8.Type) throws -> UInt8 { try columnDecoder.decode(type) } func decode(_ type: UInt16.Type) throws -> UInt16 { try columnDecoder.decode(type) } func decode(_ type: UInt32.Type) throws -> UInt32 { try columnDecoder.decode(type) } func decode(_ type: UInt64.Type) throws -> UInt64 { try columnDecoder.decode(type) } -#if compiler(>=6) @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) func decode(_ type: UInt128.Type) throws -> UInt128 { try columnDecoder.decode(type) } -#endif - + func decode(_ type: T.Type) throws -> T where T: Decodable { if let type = T.self as? any FetchableRecord.Type { // Prefer FetchableRecord decoding over Decodable. diff --git a/Package.swift b/Package.swift index 36937d039a..72875fe2d4 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:6.0 +// swift-tools-version:6.1 // 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 920bd60690..4261c65e8f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@
- +