Skip to content

Commit b38a1dc

Browse files
committed
wip
1 parent bbb4c8a commit b38a1dc

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed

Sources/StructuredQueriesCore/QueryBindable.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public protocol QueryBindable: QueryRepresentable, QueryExpression where QueryVa
1010
/// A value that can be bound to a parameter of a SQL statement.
1111
var queryBinding: QueryBinding { get }
1212

13+
/// Initializes a bindable type from a binding.
1314
init?(queryBinding: QueryBinding)
1415
}
1516

Sources/_StructuredQueriesSQLite/DatabaseFunction.swift

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -90,38 +90,3 @@ extension QueryBinding {
9090
}
9191
}
9292
}
93-
94-
private final class Stream<Element>: Sequence {
95-
private let condition = NSCondition()
96-
private var buffer: [Element] = []
97-
private var isFinished = false
98-
99-
func send(_ element: Element) {
100-
condition.withLock {
101-
buffer.append(element)
102-
condition.signal()
103-
}
104-
}
105-
106-
func finish() {
107-
condition.withLock {
108-
isFinished = true
109-
condition.broadcast()
110-
}
111-
}
112-
113-
func makeIterator() -> Iterator { Iterator(base: self) }
114-
115-
struct Iterator: IteratorProtocol {
116-
fileprivate let base: Stream
117-
mutating func next() -> Element? {
118-
base.condition.withLock {
119-
while base.buffer.isEmpty && !base.isFinished {
120-
base.condition.wait()
121-
}
122-
guard !base.buffer.isEmpty else { return nil }
123-
return base.buffer.removeFirst()
124-
}
125-
}
126-
}
127-
}

0 commit comments

Comments
 (0)