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.
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.codec_entry() = {epgsql:type_name(), Mod::codec_mod(), CallbackState::any()}
codec_mod() = module()
codec_state() = any()
decode/4 | |
decode_text/4 | |
encode/4 | |
init_mods/2 |
decode(Mod::codec_mod(), Cell::binary(), TypeName::epgsql:type_name(), CodecState::codec_state()) -> any()
decode_text(Mod::codec_mod(), Cell::binary(), TypeName::epgsql:type_name(), CodecState::codec_state()) -> any()
encode(Mod::codec_mod(), Cell::any(), TypeName::epgsql:type_name(), CodecState::codec_state()) -> iodata()
init_mods(Codecs::[{codec_mod(), any()}], PgSock::epgsql_sock:pg_sock()) -> ordsets:ordset(codec_entry())
Generated by EDoc