Skip to content

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>) -> ()) async throws where D : Decodable, D : SendableMetatype

Parameters

type

The type of the desired values.

decoder

A configured SQLRowDecoder to use.

handler

A closure which receives the result of each decoding operation, row by row.

See Also

Getting Rows

  • run(_:)
    Run the query specified by the builder, calling the provided handler closure with each output row, if any, as it is received.
  • run(decoding:_:)
    Using a default-configured SQLRowDecoder, call the provided handler closure with the result of decoding each output row, if any, as a given type.
  • run(decoding:prefix:keyDecodingStrategy:userInfo:_:)
    Configure a new SQLRowDecoder as 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.