Instance Method
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.@preconcurrency func run<D>(decoding type: D.Type, prefix: String? = nil, keyDecodingStrategy: SQLRowDecoder.KeyDecodingStrategy = .useDefaultKeys, userInfo: [CodingUserInfoKey : any Sendable] = [:], _ handler: @escaping @Sendable (Result<D, any Error>) -> ()) async throws where D : Decodable, D : SendableMetatype
Parameters
typeThe type of the desired values.
prefixSee
prefix.keyDecodingStrategySee
keyDecodingStrategy.userInfoSee
userInfo.handlerA closure which receives the result of each decoding operation, row by row.
See Also
Getting Rows
func run((any SQLRow) -> ()) async throwsRun 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>) -> ()) async throwsUsing 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, with: SQLRowDecoder, (Result<D, any Error>) -> ()) async throwsUsing the givenSQLRowDecoder, call the provided handler closure with the result of decoding each output row, if any, as a given type.