Skip to content

Instance Method

decode(_:file:line:)

Decode the cell into a Swift type that conforms to PostgresDecodable.
func decode<T>(_: T.Type, file: String = #fileID, line: Int = #line) throws -> T where T : PostgresDecodable

Parameters

_

The Swift type, which conforms to PostgresDecodable, to decode from the cell’s bytes value.

file

The source file in which this method was called. Used in the error case in PostgresDecodingError.

line

The source file line in which this method was called. Used in the error case in PostgresDecodingError.

Return Value

A decoded Swift type.

Mentioned in