diff --git a/.spi.yml b/.spi.yml index 672a6aac0..d72ab58e9 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 6edc31973..599df31db 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 70065f822..a58b8eea3 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 3edf3611c..99c2c0475 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 36937d039..72875fe2d 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 920bd6069..4261c65e8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@

- Swift 6 + Swift 6.1 License CI Status

@@ -27,7 +27,7 @@ **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) -**Requirements**: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ • SQLite 3.20.0+ • Swift 6+ / Xcode 16+ +**Requirements**: iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 7.0+ • SQLite 3.20.0+ • Swift 6.1+ / Xcode 16.3+ **Contact**: diff --git a/SQLiteCustom/GRDB.xcconfig b/SQLiteCustom/GRDB.xcconfig index 85a9b5316..54f7e82a4 100755 --- a/SQLiteCustom/GRDB.xcconfig +++ b/SQLiteCustom/GRDB.xcconfig @@ -13,4 +13,4 @@ OTHER_CFLAGS = -DUSING_BUILTIN_SQLITE -DGRDBCUSTOMSQLITE $(CUSTOM_SQLLIBRARY_CFL GCC_PREPROCESSOR_DEFINITIONS = "GRDBCUSTOMSQLITE=1" OTHER_SWIFT_FLAGS = -D USING_BUILTIN_SQLITE -D GRDBCUSTOMSQLITE $(CUSTOM_OTHER_SWIFT_FLAGS) HEADER_SEARCH_PATHS = $(SRCROOT)/SQLiteCustom/src -SWIFT_VERSION = 6.0 +SWIFT_VERSION = 6.1 diff --git a/Support/GRDB.xcconfig b/Support/GRDB.xcconfig index a3fabb088..d458e838c 100644 --- a/Support/GRDB.xcconfig +++ b/Support/GRDB.xcconfig @@ -3,7 +3,7 @@ INFOPLIST_FILE = Support/Info.plist PRODUCT_NAME = GRDB PRODUCT_BUNDLE_IDENTIFIER = com.github.groue.$(PRODUCT_NAME:rfc1034identifier) MODULEMAP_FILE = $(SRCROOT)/Support/module.modulemap -SWIFT_VERSION = 6.0 +SWIFT_VERSION = 6.1 // Slow compilation hunt: // OTHER_SWIFT_FLAGS = $(inherited) -Xfrontend -warn-long-expression-type-checking=100 -Xfrontend -warn-long-function-bodies=100 diff --git a/Tests/GRDBTests/AssociationAggregateTests.swift b/Tests/GRDBTests/AssociationAggregateTests.swift index 268172100..5037651ff 100644 --- a/Tests/GRDBTests/AssociationAggregateTests.swift +++ b/Tests/GRDBTests/AssociationAggregateTests.swift @@ -122,7 +122,6 @@ class AssociationAggregateTests: GRDBTestCase { } } - #if compiler(>=6.1) func testAggregateWithGroup_swift61() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.read { db in @@ -139,7 +138,6 @@ class AssociationAggregateTests: GRDBTestCase { """) } } - #endif func testAnnotatedWithHasManyDefaultAverage() throws { let dbQueue = try makeDatabaseQueue() @@ -296,7 +294,6 @@ class AssociationAggregateTests: GRDBTestCase { } } - #if compiler(>=6.1) func testAnnotatedWithHasManyDefaultMax_Swift61() throws { let dbQueue = try makeDatabaseQueue() try dbQueue.read { db in @@ -333,7 +330,6 @@ class AssociationAggregateTests: GRDBTestCase { XCTAssertEqual(teamInfos[3].maxPlayerScore, 0) } } - #endif func testAnnotatedWithHasManyDefaultMaxJoiningRequired() throws { // It is important to have an explicit test for this technique because diff --git a/Tests/GRDBTests/AssociationBelongsToDecodableRecordTests.swift b/Tests/GRDBTests/AssociationBelongsToDecodableRecordTests.swift index 9e1518cf8..4a6a2baf8 100644 --- a/Tests/GRDBTests/AssociationBelongsToDecodableRecordTests.swift +++ b/Tests/GRDBTests/AssociationBelongsToDecodableRecordTests.swift @@ -53,14 +53,12 @@ private extension QueryInterfaceRequest { .order { [teamAlias[Team.Columns.name], $0.name] } } -#if compiler(>=6.1) func orderedByTeamName_swift61() -> QueryInterfaceRequest { let teamAlias = TableAlias() return self .joining(optional: PlayerWithOptionalTeam.team.aliased(teamAlias)) .order { [teamAlias.name, $0.name] } } -#endif } /// Test support for Decodable records @@ -190,7 +188,6 @@ class AssociationBelongsToDecodableRecordTests: GRDBTestCase { XCTAssertEqual(records[0].team.name, "Reds") } -#if compiler(>=6.1) func testRequestRefining_swift61() throws { let dbQueue = try makeDatabaseQueue() let request = Player @@ -212,5 +209,4 @@ class AssociationBelongsToDecodableRecordTests: GRDBTestCase { XCTAssertEqual(records[0].team.id, 1) XCTAssertEqual(records[0].team.name, "Reds") } -#endif } diff --git a/Tests/GRDBTests/AssociationBelongsToSQLDerivationTests.swift b/Tests/GRDBTests/AssociationBelongsToSQLDerivationTests.swift index 694d63eb1..655365491 100644 --- a/Tests/GRDBTests/AssociationBelongsToSQLDerivationTests.swift +++ b/Tests/GRDBTests/AssociationBelongsToSQLDerivationTests.swift @@ -119,7 +119,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase { JOIN "b" ON "b"."id" = "a"."bid" """) } - #if compiler(>=6.1) do { let aAlias = TableAlias() let request = A @@ -135,7 +134,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase { JOIN "b" ON "b"."id" = "a"."bid" """) } - #endif } } @@ -178,7 +176,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase { JOIN "b" ON ("b"."id" = "a"."bid") AND ("b"."id" IN ("a"."id", "b"."id", 42)) """) } - #if compiler(>=6.1) do { let alias = TableAlias() let request = A @@ -191,7 +188,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase { JOIN "b" ON ("b"."id" = "a"."bid") AND ("b"."id" IN ("a"."id", "b"."id", 42)) """) } - #endif do { let request = A.including(required: A.b.filter(key: ["id": 1])) try assertEqualSQL(db, request, """ @@ -237,7 +233,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase { WHERE "b"."name" IS NOT NULL """) } - #if compiler(>=6.1) do { let bAlias = TableAlias() let request = A @@ -250,7 +245,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase { WHERE "b"."name" IS NOT NULL """) } - #endif } } diff --git a/Tests/GRDBTests/AssociationHasOneSQLDerivationTests.swift b/Tests/GRDBTests/AssociationHasOneSQLDerivationTests.swift index 686fa14b7..85329f82f 100644 --- a/Tests/GRDBTests/AssociationHasOneSQLDerivationTests.swift +++ b/Tests/GRDBTests/AssociationHasOneSQLDerivationTests.swift @@ -119,7 +119,6 @@ class AssociationHasOneSQLDerivationTests: GRDBTestCase { JOIN "b" ON "b"."aid" = "a"."id" """) } - #if compiler(>=6.1) do { let aAlias = TableAlias() let request = A @@ -135,7 +134,6 @@ class AssociationHasOneSQLDerivationTests: GRDBTestCase { JOIN "b" ON "b"."aid" = "a"."id" """) } - #endif } } @@ -211,7 +209,6 @@ class AssociationHasOneSQLDerivationTests: GRDBTestCase { WHERE "b"."name" IS NOT NULL """) } - #if compiler(>=6.1) do { let bAlias = TableAlias() let request = A @@ -224,7 +221,6 @@ class AssociationHasOneSQLDerivationTests: GRDBTestCase { WHERE "b"."name" IS NOT NULL """) } - #endif } } diff --git a/Tests/GRDBTests/AssociationHasOneThroughSQLDerivationTests.swift b/Tests/GRDBTests/AssociationHasOneThroughSQLDerivationTests.swift index 913327259..e793a9180 100644 --- a/Tests/GRDBTests/AssociationHasOneThroughSQLDerivationTests.swift +++ b/Tests/GRDBTests/AssociationHasOneThroughSQLDerivationTests.swift @@ -138,7 +138,6 @@ class AssociationHasOneThroughSQLDerivationTests: GRDBTestCase { JOIN "c" ON "c"."id" = "b"."cId" """) } - #if compiler(>=6.1) do { let aAlias = TableAlias() let request = A @@ -155,7 +154,6 @@ class AssociationHasOneThroughSQLDerivationTests: GRDBTestCase { JOIN "c" ON "c"."id" = "b"."cId" """) } - #endif } } @@ -238,7 +236,6 @@ class AssociationHasOneThroughSQLDerivationTests: GRDBTestCase { WHERE "c"."name" IS NOT NULL """) } - #if compiler(>=6.1) do { let cAlias = TableAlias() let request = A @@ -252,7 +249,6 @@ class AssociationHasOneThroughSQLDerivationTests: GRDBTestCase { WHERE "c"."name" IS NOT NULL """) } - #endif } } diff --git a/Tests/GRDBTests/AssociationTableAliasTestsSQLTests.swift b/Tests/GRDBTests/AssociationTableAliasTestsSQLTests.swift index c95f3a266..f7ff69f36 100644 --- a/Tests/GRDBTests/AssociationTableAliasTestsSQLTests.swift +++ b/Tests/GRDBTests/AssociationTableAliasTestsSQLTests.swift @@ -130,7 +130,6 @@ class AssociationTableAliasTestsSQLTests : GRDBTestCase { } } - #if compiler(>=6.1) func testTableAliasBasics_swift61() throws { // A table reference qualifies all unqualified selectables, expressions, and orderings @@ -208,7 +207,6 @@ class AssociationTableAliasTestsSQLTests : GRDBTestCase { } } } - #endif func testRecursiveRelationDepth1() throws { // A.include(A.parent) diff --git a/Tests/GRDBTests/CommonTableExpressionTests.swift b/Tests/GRDBTests/CommonTableExpressionTests.swift index 1d87105e4..361379974 100644 --- a/Tests/GRDBTests/CommonTableExpressionTests.swift +++ b/Tests/GRDBTests/CommonTableExpressionTests.swift @@ -101,7 +101,6 @@ class CommonTableExpressionTests: GRDBTestCase { LEFT JOIN "cte" ON "t"."id" > "cte"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression(named: "cte", request: T.all()) let request = T.all() @@ -114,7 +113,6 @@ class CommonTableExpressionTests: GRDBTestCase { LEFT JOIN "cte" ON "t"."id" > "cte"."id" """) } - #endif // Include SQL request as a CTE do { @@ -131,7 +129,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" = "cte"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression( named: "cte", @@ -146,7 +143,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" = "cte"."id" """) } - #endif // Include a filtered SQL request as a CTE do { @@ -180,7 +176,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" = "cte"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression( named: "cte", @@ -196,7 +191,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" = "cte"."id" """) } - #endif // Include SQL request as a CTE (custom column name) do { @@ -214,7 +208,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" = "cte"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression( named: "cte", @@ -230,7 +223,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" = "cte"."id" """) } - #endif // Include SQL request as a CTE (empty ON clause) do { @@ -261,7 +253,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" > "cte"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression(named: "cte", request: T.all()) let request = T.all() @@ -274,7 +265,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" > "cte"."id" """) } - #endif // Include filtered CTE do { @@ -336,7 +326,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" > "cte"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression(named: "cte", request: T.all()) let request = T.all() @@ -350,7 +339,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON "t"."id" > "cte"."id" """) } - #endif // Include one CTE twice with same key but different condition (last condition wins) do { @@ -366,7 +354,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON ("t"."id" + "cte"."id") = 1 """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression(named: "cte", request: T.all()) let request = T.all() @@ -380,7 +367,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" ON ("t"."id" + "cte"."id") = 1 """) } - #endif // Include one CTE twice with different keys do { @@ -397,7 +383,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" "cte2" ON "t"."id" < "cte2"."id" """) } - #if compiler(>=6.1) do { let cte = CommonTableExpression(named: "cte", request: T.all()) let request = T.all() @@ -412,7 +397,6 @@ class CommonTableExpressionTests: GRDBTestCase { JOIN "cte" "cte2" ON "t"."id" < "cte2"."id" """) } - #endif // Chain CTE includes do { diff --git a/Tests/GRDBTests/GRDBTestCase.swift b/Tests/GRDBTests/GRDBTestCase.swift index 915702a98..077dd2d46 100644 --- a/Tests/GRDBTests/GRDBTestCase.swift +++ b/Tests/GRDBTests/GRDBTestCase.swift @@ -271,8 +271,3 @@ struct AnyValueReducerFetcher: _ValueReducerFetcher { try _fetch(db) } } - -#if compiler(<6.1) -// XCTestExpectation is Sendable starting Xcode 16.3 beta. -extension XCTestExpectation: @unchecked Sendable { } -#endif diff --git a/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift b/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift index 93592c7c6..b1e7a1b4d 100644 --- a/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift +++ b/Tests/GRDBTests/QueryInterfaceExpressionsTests.swift @@ -481,7 +481,6 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { SELECT * FROM "team" WHERE EXISTS (SELECT * FROM "player" WHERE "teamID" = "team"."id") """) } - #if compiler(>=6.1) do { let teamAlias = TableAlias() let player = Player.filter { $0.teamID == teamAlias.id } @@ -490,7 +489,6 @@ class QueryInterfaceExpressionsTests: GRDBTestCase { SELECT * FROM "team" WHERE EXISTS (SELECT * FROM "player" WHERE "teamID" = "team"."id") """) } - #endif } } diff --git a/Tests/GRDBTests/QueryInterfaceRequestTests.swift b/Tests/GRDBTests/QueryInterfaceRequestTests.swift index 43e510b95..cf93a8f6e 100644 --- a/Tests/GRDBTests/QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/QueryInterfaceRequestTests.swift @@ -415,7 +415,6 @@ class QueryInterfaceRequestTests: GRDBTestCase { JOIN "author" ON "author"."id" = "book"."authorId" """) } - #if compiler(>=6.1) do { let alias = TableAlias() let request = Book @@ -435,7 +434,6 @@ class QueryInterfaceRequestTests: GRDBTestCase { JOIN "author" ON "author"."id" = "book"."authorId" """) } - #endif } } @@ -912,11 +910,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age }), "SELECT * FROM \"readers\" ORDER BY \"age\"") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age)), "SELECT * FROM \"readers\" ORDER BY \"age\"") - #endif XCTAssertEqual( sql(dbQueue, tableRequest.order(Columns.age.asc)), @@ -924,11 +920,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age.asc }), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age.asc)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC") - #endif XCTAssertEqual( sql(dbQueue, tableRequest.order(Columns.age.desc)), @@ -936,11 +930,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age.desc }), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age.desc)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC") - #endif XCTAssertEqual( sql(dbQueue, tableRequest.order(Columns.age, Columns.name.desc)), @@ -963,11 +955,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age.ascNullsLast }), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age.ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #endif XCTAssertEqual( sql(dbQueue, tableRequest.order(Columns.age.descNullsFirst)), @@ -975,11 +965,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age.descNullsFirst }), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age.descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #endif #elseif !GRDBCIPHER if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( @@ -988,11 +976,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age.ascNullsLast }), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age.ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #endif XCTAssertEqual( sql(dbQueue, tableRequest.order(Columns.age.descNullsFirst)), @@ -1000,11 +986,9 @@ class QueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, tableRequest.order { $0.age.descNullsFirst }), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, tableRequest.order(\.age.descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #endif } #endif } diff --git a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift index 8df2e73a6..a40d67b05 100644 --- a/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift +++ b/Tests/GRDBTests/TableRecord+QueryInterfaceRequestTests.swift @@ -303,11 +303,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age }), "SELECT * FROM \"readers\" ORDER BY \"age\"") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age)), "SELECT * FROM \"readers\" ORDER BY \"age\"") - #endif XCTAssertEqual( sql(dbQueue, Reader.order(Columns.age.asc)), @@ -315,11 +313,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age.asc }), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age.asc)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC") - #endif XCTAssertEqual( sql(dbQueue, Reader.order(Columns.age.desc)), @@ -327,11 +323,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age.desc }), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age.desc)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC") - #endif XCTAssertEqual( sql(dbQueue, Reader.order(Columns.age, Columns.name.desc)), @@ -354,11 +348,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age.ascNullsLast }), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age.ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #endif XCTAssertEqual( sql(dbQueue, Reader.order(Columns.age.descNullsFirst)), @@ -366,11 +358,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age.descNullsFirst }), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age.descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #endif #elseif !GRDBCIPHER if #available(iOS 14, macOS 10.16, tvOS 14, *) { XCTAssertEqual( @@ -379,11 +369,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age.ascNullsLast }), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age.ascNullsLast)), "SELECT * FROM \"readers\" ORDER BY \"age\" ASC NULLS LAST") - #endif XCTAssertEqual( sql(dbQueue, Reader.order(Columns.age.descNullsFirst)), @@ -391,11 +379,9 @@ class TableRecordQueryInterfaceRequestTests: GRDBTestCase { XCTAssertEqual( sql(dbQueue, Reader.order { $0.age.descNullsFirst }), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #if compiler(>=6.1) XCTAssertEqual( sql(dbQueue, Reader.order(\.age.descNullsFirst)), "SELECT * FROM \"readers\" ORDER BY \"age\" DESC NULLS FIRST") - #endif } #endif } diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index ae5c09ff8..d1aa1250f 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -952,11 +952,7 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(counts.sorted(), counts) // Observation was ended -#if compiler(>=5.8) await fulfillment(of: [cancellationExpectation], timeout: 2) -#else - wait(for: [cancellationExpectation], timeout: 2) -#endif } try await AsyncTest(test).run { try DatabaseQueue() } @@ -993,11 +989,7 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(counts.sorted(), counts) // Observation was ended -#if compiler(>=5.8) await fulfillment(of: [cancellationExpectation], timeout: 2) -#else - wait(for: [cancellationExpectation], timeout: 2) -#endif } try await AsyncTest(test).run { try DatabaseQueue() } @@ -1043,11 +1035,7 @@ class ValueObservationTests: GRDBTestCase { XCTAssertEqual(cancelledValue, "cancelled loop") // Make sure observation was cancelled as well -#if compiler(>=5.8) await fulfillment(of: [cancellationExpectation], timeout: 2) -#else - wait(for: [cancellationExpectation], timeout: 2) -#endif } try await AsyncTest(test).run { try DatabaseQueue() } diff --git a/Tests/SPM/PlainPackage/Package.swift b/Tests/SPM/PlainPackage/Package.swift index 6b6996999..001925b4d 100644 --- a/Tests/SPM/PlainPackage/Package.swift +++ b/Tests/SPM/PlainPackage/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 PackageDescription diff --git a/Tests/Swift6Migration/LanguageMode6.xcconfig b/Tests/Swift6Migration/LanguageMode6.xcconfig index 3ce1f8ea2..2a034a2d5 100644 --- a/Tests/Swift6Migration/LanguageMode6.xcconfig +++ b/Tests/Swift6Migration/LanguageMode6.xcconfig @@ -1,5 +1,5 @@ // Swift 6 mode -SWIFT_VERSION = 6.0 +SWIFT_VERSION = 6.1 // Recommended settings // SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES