Skip to content

Commit f058f4f

Browse files
committed
public NoopConnection
1 parent c642439 commit f058f4f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Sources/Otter/Connection.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ public protocol Connection: Sendable {
2323
}
2424

2525
/// A no operation database connection that does nothing.
26-
struct NoopConnection: Connection {
27-
func observe(subscriber: any DatabaseSubscriber) {}
28-
func cancel(subscriber: any DatabaseSubscriber) {}
26+
public struct NoopConnection: Connection {
27+
public init() {}
2928

30-
func begin<Output>(
29+
public func observe(subscriber: any DatabaseSubscriber) {}
30+
31+
public func cancel(subscriber: any DatabaseSubscriber) {}
32+
33+
public func begin<Output>(
3134
_ kind: Transaction.Kind,
3235
execute: @Sendable (borrowing Transaction) throws -> Output
3336
) async throws -> Output {
@@ -44,7 +47,7 @@ public protocol ConnectionWrapper: Connection {
4447
var connection: any Connection { get }
4548
}
4649

47-
extension ConnectionWrapper {
50+
public extension ConnectionWrapper {
4851
func observe(subscriber: DatabaseSubscriber) {
4952
connection.observe(subscriber: subscriber)
5053
}

0 commit comments

Comments
 (0)