Module epgsql_codec_json

Codec for json, jsonb

Behaviours: epgsql_codec.

This module defines the epgsql_codec_json behaviour.
Required callback functions: encode/1, decode/1.
Optional callback functions: encode/2, decode/2.

Description

Codec for json, jsonb

It is possible to instruct the codec to do JSON encoding/decoding to Erlang terms by providing callback module name, see json_mod().

Data Types

data()

data() = binary()

json_mod()

json_mod() = module() | {module(), EncodeOpts::any(), DecodeOpts::any()}

Function Index

decode/3
decode_text/3
encode/3
init/2
names/0

Function Details

decode/3

decode(Bin, X2, JsonMod) -> any()

decode_text/3

decode_text(V, X2, X3) -> any()

encode/3

encode(ErlJson, X2, JsonMod) -> any()

init/2

init(JsonMod::json_mod(), X2::epgsql_sock:pg_sock()) -> epgsql_codec:codec_state()

names/0

names() -> any()


Generated by EDoc