Postgrex v0.12.0 Postgrex.Extensions.JSON

An extension that supports the json and jsonb types.

This extension is not used by default, it needs to be included in the :extensions option to Postgrex.start_link/1.

Options

  • :library - The module to encode and decode JSON binaries, calls module.encode!/1 to encode and module.decode!/1 to decode (required);
  • :decode_binary - Either :copy to copy binary values before decoding with the library module or :reference to use a reference counted binary of the binary received from the socket. Referencing a potentially larger binary can be more efficient if the binary value is going to be garbaged collected soon because a copy is avoided. However the larger binary can not be garbage collected until all references are garbage collected (defaults to :copy);

Summary

Functions

decode(type_info, json, state, arg4)

Callback implementation for Postgrex.Extension.decode/4.

encode(type_info, map, state, arg)

Callback implementation for Postgrex.Extension.encode/4.

format()

Callback implementation for Postgrex.Extension.format/1.

init(parameters, opts)

Callback implementation for Postgrex.Extension.init/2.

matching()

Callback implementation for Postgrex.Extension.matching/1.