Skip to content

Instance Method

decode(model:with:)

Decode an entire Decodable “model” type at once using an explicit SQLRowDecoder.
func decode<D>(model type: D.Type, with decoder: SQLRowDecoder) throws -> D where D : Decodable

Parameters

type

The type to decode.

decoder

The SQLRowDecoder to use for decoding.

Return Value

An instance of the decoded type.

Discussion

See SQLRowDecoder for additional details.

Most users should consider using all(decoding:with:) and/or first(decoding:with:) instead.