PostgresNIO Documentation

Protocol Postgres​JSONDecoder

public protocol PostgresJSONDecoder  

A protocol that mimicks the Foundation JSONDecoder.decode(_:from:) function. Conform a non-Foundation JSON decoder to this protocol if you want PostgresNIO to be able to use it when decoding JSON & JSONB values (see PostgresNIO._defaultJSONDecoder)

Default Implementations

decode(_:​from:​)

public func decode<T: Decodable>(_ type: T.Type, from buffer: ByteBuffer) throws -> T  

Requirements

decode(_:​from:​)

func decode<T>(_ type: T.Type, from data: Data) throws -> T where T : Decodable

decode(_:​from:​)

func decode<T: Decodable>(_ type: T.Type, from buffer: ByteBuffer) throws -> T