Module epgsql_codec

Behaviour for postgresql datatype codecs.

This module defines the epgsql_codec behaviour.
Required callback functions: init/2, names/0, encode/3, decode/3.
Optional callback functions: decode_text/3.

See also: epgsql_binary.

Description

Behaviour for postgresql datatype codecs.

XXX: this module and callbacks "know nothing" about OIDs. XXX: state of codec shouldn't leave epgsql_sock process. If you need to return "pointer" to data type/codec, it's better to return OID or type name.

Data Types

codec_entry()

codec_entry() = {epgsql:type_name(), Mod::codec_mod(), CallbackState::any()}

codec_mod()

codec_mod() = module()

codec_state()

codec_state() = any()

Function Index

decode/4
decode_text/4
encode/4
init_mods/2

Function Details

decode/4

decode(Mod::codec_mod(), Cell::binary(), TypeName::epgsql:type_name(), CodecState::codec_state()) -> any()

decode_text/4

decode_text(Mod::codec_mod(), Cell::binary(), TypeName::epgsql:type_name(), CodecState::codec_state()) -> any()

encode/4

encode(Mod::codec_mod(), Cell::any(), TypeName::epgsql:type_name(), CodecState::codec_state()) -> iodata()

init_mods/2

init_mods(Codecs::[{codec_mod(), any()}], PgSock::epgsql_sock:pg_sock()) -> ordsets:ordset(codec_entry())


Generated by EDoc