Instance Method
first(decodingColumn:as:)
Returns the named column from the first output row, if any, decoded as a given type.
func first<D>(decodingColumn column: String, as type: D.Type) async throws -> D? where D : Decodable
Parameters
columnThe name of the column to decode.
typeThe type of the desired value.
Return Value
The decoded value, if any.
See Also
Getting One Row
func first() async throws -> Optional<any SQLRow>Returns the first output row, if any.func first<D>(decoding: D.Type) async throws -> 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]) async throws -> 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) async throws -> D?Using the givenSQLRowDecoder, returns the first output row, if any, decoded as a given type.