[BREAKING] Bump minimum Swift version to 6.1

This commit is contained in:
Gwendal Roué committed 2025-10-04 13:53:38 +02:00
1 parent ab09078842
commit edc1d646f0
22 files changed
+14 -107

No files matched your search

+1 -1
View File
@@ -2,4 +2,4 @@ version: 1
builder:
configs:
- documentation_targets: [GRDB]
swift_version: 6.0
swift_version: 6.1
@@ -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";
};
+1 -1
View File
@@ -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'
+1 -5
View File
@@ -519,20 +519,16 @@ private struct SingleValueRowDecoder<R: FetchableRecord>: 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<T>(_ type: T.Type) throws -> T where T: Decodable {
if let type = T.self as? any FetchableRecord.Type {
// Prefer FetchableRecord decoding over Decodable.
+1 -1
View File
@@ -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
+2 -2
View File
@@ -10,7 +10,7 @@
</p>
<p align="center">
<a href="https://developer.apple.com/swift/"><img alt="Swift 6" src="https://img.shields.io/badge/swift-6-orange.svg?style=flat"></a>
<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>
<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>
<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>
</p>
@@ -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+ &bull; SQLite 3.20.0+ &bull; Swift 6+ / Xcode 16+
**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+
**Contact**:
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
@@ -53,14 +53,12 @@ private extension QueryInterfaceRequest<Player> {
.order { [teamAlias[Team.Columns.name], $0.name] }
}
#if compiler(>=6.1)
func orderedByTeamName_swift61() -> QueryInterfaceRequest<Player> {
let teamAlias = TableAlias<Team>()
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
}
@@ -119,7 +119,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase {
JOIN "b" ON "b"."id" = "a"."bid"
""")
}
#if compiler(>=6.1)
do {
let aAlias = TableAlias<A>()
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<A>()
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<B>()
let request = A
@@ -250,7 +245,6 @@ class AssociationBelongsToSQLDerivationTests: GRDBTestCase {
WHERE "b"."name" IS NOT NULL
""")
}
#endif
}
}
@@ -119,7 +119,6 @@ class AssociationHasOneSQLDerivationTests: GRDBTestCase {
JOIN "b" ON "b"."aid" = "a"."id"
""")
}
#if compiler(>=6.1)
do {
let aAlias = TableAlias<A>()
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<B>()
let request = A
@@ -224,7 +221,6 @@ class AssociationHasOneSQLDerivationTests: GRDBTestCase {
WHERE "b"."name" IS NOT NULL
""")
}
#endif
}
}
@@ -138,7 +138,6 @@ class AssociationHasOneThroughSQLDerivationTests: GRDBTestCase {
JOIN "c" ON "c"."id" = "b"."cId"
""")
}
#if compiler(>=6.1)
do {
let aAlias = TableAlias<A>()
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<C>()
let request = A
@@ -252,7 +249,6 @@ class AssociationHasOneThroughSQLDerivationTests: GRDBTestCase {
WHERE "c"."name" IS NOT NULL
""")
}
#endif
}
}
@@ -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)
@@ -101,7 +101,6 @@ class CommonTableExpressionTests: GRDBTestCase {
LEFT JOIN "cte" ON "t"."id" > "cte"."id"
""")
}
#if compiler(>=6.1)
do {
let cte = CommonTableExpression<T>(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<T>(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<T>(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<T>(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<T>(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 {
-5
View File
@@ -271,8 +271,3 @@ struct AnyValueReducerFetcher<Fetched>: _ValueReducerFetcher {
try _fetch(db)
}
}
#if compiler(<6.1)
// XCTestExpectation is Sendable starting Xcode 16.3 beta.
extension XCTestExpectation: @unchecked Sendable { }
#endif
@@ -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<Team>()
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
}
}
@@ -415,7 +415,6 @@ class QueryInterfaceRequestTests: GRDBTestCase {
JOIN "author" ON "author"."id" = "book"."authorId"
""")
}
#if compiler(>=6.1)
do {
let alias = TableAlias<Author>()
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
}
@@ -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
}
@@ -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() }
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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