diff --git a/GRDB/Core/DatabaseError.swift b/GRDB/Core/DatabaseError.swift index ee205083a..6530f58fa 100644 --- a/GRDB/Core/DatabaseError.swift +++ b/GRDB/Core/DatabaseError.swift @@ -197,7 +197,7 @@ extension ResultCode { } } -extension ResultCode: GRDBSendable { } +extension ResultCode: Sendable { } /// DatabaseError wraps an SQLite error. public struct DatabaseError: Error, CustomStringConvertible, CustomNSError { diff --git a/GRDB/Core/DatabaseReader.swift b/GRDB/Core/DatabaseReader.swift index d5ff1f34f..f2719ab1f 100644 --- a/GRDB/Core/DatabaseReader.swift +++ b/GRDB/Core/DatabaseReader.swift @@ -19,7 +19,7 @@ import Dispatch /// connection to the database. Should you have to cope with external /// connections, protect yourself with transactions, and be ready to setup a /// [busy handler](https://www.sqlite.org/c3ref/busy_handler.html). -public protocol DatabaseReader: AnyObject, GRDBSendable { +public protocol DatabaseReader: AnyObject, Sendable { /// The database configuration var configuration: Configuration { get } diff --git a/GRDB/Core/DatabaseValue.swift b/GRDB/Core/DatabaseValue.swift index 41e02913f..86172505b 100644 --- a/GRDB/Core/DatabaseValue.swift +++ b/GRDB/Core/DatabaseValue.swift @@ -157,7 +157,7 @@ extension DatabaseValue: StatementBinding { } } -extension DatabaseValue: GRDBSendable { } +extension DatabaseValue: Sendable { } #if swift(>=5.6) && canImport(_Concurrency) // @unchecked due to Foundation.Data not conforming to Sendable diff --git a/GRDB/Core/DatabaseWriter.swift b/GRDB/Core/DatabaseWriter.swift index 3ab24d3ea..df7376e20 100644 --- a/GRDB/Core/DatabaseWriter.swift +++ b/GRDB/Core/DatabaseWriter.swift @@ -384,7 +384,6 @@ extension DatabaseWriter { extension DatabaseWriter { // MARK: - Asynchronous Database Access - // TODO: remove @escaping as soon as it is possible /// Asynchronously executes database updates, wrapped inside a transaction, /// and returns the result. /// @@ -408,7 +407,6 @@ extension DatabaseWriter { } } - // TODO: remove @escaping as soon as it is possible /// Asynchronously executes database updates, outside of any transaction, /// and returns the result. /// @@ -432,7 +430,6 @@ extension DatabaseWriter { } } - // TODO: remove @escaping as soon as it is possible /// Asynchronously executes database updates, outside of any transaction, /// and returns the result. /// diff --git a/GRDB/Core/RowDecodingError.swift b/GRDB/Core/RowDecodingError.swift index 54cf0d6f8..657c110d6 100644 --- a/GRDB/Core/RowDecodingError.swift +++ b/GRDB/Core/RowDecodingError.swift @@ -1,6 +1,6 @@ /// A key that is used to decode a value in a row @usableFromInline -enum RowKey: Hashable, GRDBSendable { +enum RowKey: Hashable, Sendable { /// A column name case columnName(String) @@ -18,7 +18,7 @@ enum RowKey: Hashable, GRDBSendable { @usableFromInline enum RowDecodingError: Error { @usableFromInline - struct Context: CustomDebugStringConvertible, GRDBSendable { + struct Context: CustomDebugStringConvertible, Sendable { /// A description of what went wrong, for debugging purposes. @usableFromInline let debugDescription: String diff --git a/GRDB/Core/Statement.swift b/GRDB/Core/Statement.swift index 2017130d5..a994296a1 100644 --- a/GRDB/Core/Statement.swift +++ b/GRDB/Core/Statement.swift @@ -940,4 +940,4 @@ extension StatementArguments { } } -extension StatementArguments: GRDBSendable { } +extension StatementArguments: Sendable { } diff --git a/GRDB/Utils/Utils.swift b/GRDB/Utils/Utils.swift index f42e0f2ce..62b20dd37 100644 --- a/GRDB/Utils/Utils.swift +++ b/GRDB/Utils/Utils.swift @@ -32,12 +32,6 @@ public protocol _OptionalProtocol { /// :nodoc: extension Optional: _OptionalProtocol { } -#if swift(>=5.6) && canImport(_Concurrency) -public typealias GRDBSendable = Swift.Sendable -#else -public typealias GRDBSendable = Any -#endif - // MARK: - Internal /// Reserved for GRDB: do not use. diff --git a/Tests/GRDBTests/BackupTestCase.swift b/Tests/GRDBTests/BackupTestCase.swift index f4474f9b9..bc6dba2e1 100644 --- a/Tests/GRDBTests/BackupTestCase.swift +++ b/Tests/GRDBTests/BackupTestCase.swift @@ -4,7 +4,7 @@ import XCTest class BackupTestCase: GRDBTestCase { // A "user" error simply for testing purposes - private class AbandonBackupError: Error {} + private struct AbandonBackupError: Error {} private func setupBackupSource(_ writer: DatabaseWriter) throws -> Int { try writer.write { db in