Swift 5.7 required: Sendable

This commit is contained in:
Gwendal Roué committed 2022-08-21 19:21:26 +02:00
1 parent fc59b45493
commit df0ae43c5f
8 files changed
+7 -16

No files matched your search

+1 -1
View File
@@ -197,7 +197,7 @@ extension ResultCode {
}
}
extension ResultCode: GRDBSendable { }
extension ResultCode: Sendable { }
/// DatabaseError wraps an SQLite error.
public struct DatabaseError: Error, CustomStringConvertible, CustomNSError {
+1 -1
View File
@@ -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 }
+1 -1
View File
@@ -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
-3
View File
@@ -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.
///
+2 -2
View File
@@ -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
+1 -1
View File
@@ -940,4 +940,4 @@ extension StatementArguments {
}
}
extension StatementArguments: GRDBSendable { }
extension StatementArguments: Sendable { }
-6
View File
@@ -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.
+1 -1
View File
@@ -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