-
-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Milestone
Description
Does it make sense to add support for transactions in similar manner to this
extension PostgresClient {
func withTransaction<Value>(logger: Logger, _ process: (PostgresConnection) async throws -> Value) async throws -> Value {
try await withConnection { connection in
try await connection.query("BEGIN;", logger: logger)
do {
let value = try await process(connection)
try await connection.query("COMMIT;", logger: logger)
return value
} catch {
try await connection.query("ROLLBACK;", logger: logger)
throw error
}
}
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers