Skip to content

Instance Method

first(decoding:prefix:keyDecodingStrategy:userInfo:)

Configure a new SQLRowDecoder as specified and use it to decode and return the first output row, if any, as a given type.
func first<D>(decoding type: D.Type, prefix: String? = nil, keyDecodingStrategy: SQLRowDecoder.KeyDecodingStrategy = .useDefaultKeys, userInfo: [CodingUserInfoKey : any Sendable] = [:]) -> EventLoopFuture<D?> where D : Decodable, D : SendableMetatype

Parameters

type

The type of the desired value.

prefix

See prefix.

keyDecodingStrategy

See keyDecodingStrategy.

userInfo

See userInfo.

Return Value

A future containing the decoded value, if any.

See Also

Legacy `EventLoopFuture` Interfaces