mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Swift 5.7 required: Sendable
This commit is contained in:
1 parent
fc59b45493
commit
df0ae43c5f
8 files changed
+7
-16
No files matched your search
@@ -197,7 +197,7 @@ extension ResultCode {
|
||||
}
|
||||
}
|
||||
|
||||
extension ResultCode: GRDBSendable { }
|
||||
extension ResultCode: Sendable { }
|
||||
|
||||
/// DatabaseError wraps an SQLite error.
|
||||
public struct DatabaseError: Error, CustomStringConvertible, CustomNSError {
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -940,4 +940,4 @@ extension StatementArguments {
|
||||
}
|
||||
}
|
||||
|
||||
extension StatementArguments: GRDBSendable { }
|
||||
extension StatementArguments: Sendable { }
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user