Skip to content

Commit

Permalink
fix(analytics): iterate sqlite rows with failableNext
Browse files Browse the repository at this point in the history
  • Loading branch information
5d committed Sep 16, 2024
1 parent 4782923 commit 6e3889e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ class AnalyticsEventSQLStorage: AnalyticsEventStorage {
ORDER BY timestamp ASC
LIMIT ?
"""
let rows = try dbAdapter.executeQuery(queryStatement, [limit])
let rows = try dbAdapter.executeQuery(queryStatement, [limit]).makeIterator()
var result = [PinpointEvent]()
for element in rows {
while let element = try rows.failableNext() {
if let event = PinpointEvent.convertToEvent(element) {
result.append(event)
}
Expand Down

0 comments on commit 6e3889e

Please sign in to comment.