Instance Method
run(decoding:with:_:)
Using the given
SQLRowDecoder, call the provided handler closure with the result of decoding each output row, if any, as a given type.@preconcurrency func run<D>(decoding type: D.Type, with decoder: SQLRowDecoder, _ handler: @escaping @Sendable (Result<D, any Error>) -> ()) -> EventLoopFuture<Void> where D : Decodable, D : SendableMetatype
Parameters
typeThe type of the desired values.
decoderA configured
SQLRowDecoderto use.handlerA closure which receives the result of each decoding operation, row by row.
Return Value
A completion future.
See Also
Legacy `EventLoopFuture` Interfaces
func run((any SQLRow) -> ()) -> EventLoopFuture<Void>Run the query specified by the builder, calling the provided handler closure with each output row, if any, as it is received.func run<D>(decoding: D.Type, (Result<D, any Error>) -> ()) -> EventLoopFuture<Void>Using a default-configuredSQLRowDecoder, call the provided handler closure with the result of decoding each output row, if any, as a given type.func run<D>(decoding: D.Type, prefix: String?, keyDecodingStrategy: SQLRowDecoder.KeyDecodingStrategy, userInfo: [CodingUserInfoKey : any Sendable], (Result<D, any Error>) -> ()) -> EventLoopFuture<Void>Configure a newSQLRowDecoderas specified, use it to to decode each output row, if any, as a given type, and call the provided handler closure with each decoding result.func all() -> EventLoopFuture<[any SQLRow]>Returns all output rows, if any.func all<D>(decoding: D.Type) -> EventLoopFuture<[D]>Using a default-configuredSQLRowDecoder, returns all output rows, if any, decoded as a given type.func all<D>(decoding: D.Type, prefix: String?, keyDecodingStrategy: SQLRowDecoder.KeyDecodingStrategy, userInfo: [CodingUserInfoKey : any Sendable]) -> EventLoopFuture<[D]>Configure a newSQLRowDecoderas specified and use it to decode and return the output rows, if any, as a given type.func all<D>(decoding: D.Type, with: SQLRowDecoder) -> EventLoopFuture<[D]>Using the givenSQLRowDecoder, returns the output rows, if any, decoded as a given type.func all<D>(decodingColumn: String, as: D.Type) -> EventLoopFuture<[D]>Returns the named column from each output row, if any, decoded as a given type.func first() -> EventLoopFuture<(any SQLRow)?>Returns the first output row, if any.func first<D>(decoding: D.Type) -> EventLoopFuture<D?>Using a default-configuredSQLRowDecoder, returns the first output row, if any, decoded as a given type.func first<D>(decoding: D.Type, prefix: String?, keyDecodingStrategy: SQLRowDecoder.KeyDecodingStrategy, userInfo: [CodingUserInfoKey : any Sendable]) -> EventLoopFuture<D?>Configure a newSQLRowDecoderas specified and use it to decode and return the first output row, if any, as a given type.func first<D>(decoding: D.Type, with: SQLRowDecoder) -> EventLoopFuture<D?>Using the givenSQLRowDecoder, returns the first output row, if any, decoded as a given type.func first<D>(decodingColumn: String, as: D.Type) -> EventLoopFuture<D?>Returns the named column from the first output row, if any, decoded as a given type.