Skip to content

Instance Method

decode(column:as:)

If the given column name exists in the row, attempt to decode it as the given type and return the result if successful.
func decode<D>(column: String, as: D.Type) throws -> D where D : Decodable

Discussion

The implementation must throw an error - preferably DecodingError.keyNotFound - if the column name does not exist in the row.

Corresponds to KeyedDecodingContainer.decode(_:forKey:).