Instance Method
query(_:_:logger:_:)
@preconcurrency func query(_ query: String, _ binds: [SQLiteData], logger: Logger, _ onRow: @escaping @Sendable (SQLiteRow) -> Void) -> EventLoopFuture<Void>
Parameters
queryThe query string to execute.
bindsAn ordered list of
SQLiteDataitems to use as bound parameters for the query.loggerIgnored. See above discussion for details.
onRowA closure to invoke for each result row returned by the query, if any.
Return Value
A future completed when the query has executed and returned all results (if any).
Discussion
This is the primary interface to connections vended via this protocol.
Warning
The logger parameter of this method is a holdover from Fluent 4’s development cycle that should have been removed before the final release. Unfortunately, this didn’t happen, and semantic versioning has left the API stuck with it ever single. Callers of this API should either always pass the value of the logger property or use query(_:_:_:) instead. Implementations that wish to conform to this protocol should ignore the parameter entirely in favor of the logger property. At no time during SQLiteNIO’s lifetime has this parameter ever been honored; indeed, at the time of this writing, SQLiteConnection‘s implementation of this method doesn’t use any logger at all.