Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/SQLite/Core/Statement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ public protocol FailableIterator: IteratorProtocol {

extension FailableIterator {
public func next() -> Element? {
// swiftlint:disable:next force_try
try! failableNext()
// Do not force try
try? failableNext()
}
}

Expand Down
5 changes: 2 additions & 3 deletions Sources/SQLite/Typed/Query.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,9 @@ extension Connection {
let statement = try prepare(expression.template, expression.bindings)

let columnNames = try columnNamesForQuery(query)
let rows = try statement.failableNext().map { Row(columnNames, $0) }

return AnySequence {
AnyIterator { statement.next().map { Row(columnNames, $0) } }
}
return AnySequence { AnyIterator { rows } }
}

public func prepareRowIterator(_ query: QueryType) throws -> RowIterator {
Expand Down