Instance Method
decode(model:prefix:keyDecodingStrategy:userInfo:)
Decode an entire
Decodable “model” type at once, optionally applying a prefix and/or SQLRowDecoder.KeyDecodingStrategy to the type’s coding keys.func decode<D>(model type: D.Type, prefix: String? = nil, keyDecodingStrategy: SQLRowDecoder.KeyDecodingStrategy = .useDefaultKeys, userInfo: [CodingUserInfoKey : any Sendable] = [:]) throws -> D where D : Decodable
Parameters
typeThe type to decode.
prefixA prefix to discard from column names when looking up coding keys.
keyDecodingStrategyA decoding strategy to use for coding keys.
userInfoSee
userInfo.
Return Value
An instance of the decoded type.
Discussion
See SQLRowDecoder for additional details.
Most users should consider using all(decoding:prefix:keyDecodingStrategy:userInfo:) and/or first(decoding:prefix:keyDecodingStrategy:userInfo:) instead.