DatabaseWriter.writeWithoutTransaction accepts a sending closure

This commit is contained in:
Gwendal Roué committed 2025-12-30 13:01:09 +01:00
1 parent aadc73cc11
commit 080f9275cc
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -798,7 +798,7 @@ extension DatabasePool: DatabaseWriter {
}
public func writeWithoutTransaction<T: Sendable>(
_ updates: @Sendable (Database) throws -> T
_ updates: sending (Database) throws -> T
) async throws -> T {
try await writer.execute(updates)
}
+1 -1
View File
@@ -397,7 +397,7 @@ extension DatabaseQueue: DatabaseWriter {
}
public func writeWithoutTransaction<T: Sendable>(
_ updates: @Sendable (Database) throws -> T
_ updates: sending (Database) throws -> T
) async throws -> T {
try await writer.execute(updates)
}
+2 -2
View File
@@ -130,7 +130,7 @@ public protocol DatabaseWriter: DatabaseReader {
/// database access, or the error thrown by `updates`, or
/// `CancellationError` if the task is cancelled.
func writeWithoutTransaction<T: Sendable>(
_ updates: @Sendable (Database) throws -> T
_ updates: sending (Database) throws -> T
) async throws -> T
/// Executes database operations, and returns their result after they have
@@ -936,7 +936,7 @@ extension AnyDatabaseWriter: DatabaseWriter {
}
public func writeWithoutTransaction<T: Sendable>(
_ updates: @Sendable (Database) throws -> T
_ updates: sending (Database) throws -> T
) async throws -> T {
try await base.writeWithoutTransaction(updates)
}