Skip to content

Instance MethodSQLiteNIO

decode(column:as:)

Deprecated

Use SQLiteRow.sql(decoder:) to access an SQLiteRow as an SQLRow.

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:).