Module epgsql_binary

Interface to encoder/decoder for binary postgres data representation.

See also: epgsql_codec, epgsql_wire.

Description

Interface to encoder/decoder for binary postgres data representation

Data Types

codec()

abstract datatype: codec()

decoder()

abstract datatype: decoder()

maybe_unknown_type()

maybe_unknown_type() = type() | {unknown_oid, epgsql_oid_db:oid()}

nulls()

nulls() = [any(), ...]

opts()

opts() = #{nulls => nulls()}

type()

type() = epgsql:type_name() | {array, epgsql:type_name()}

Function Index

decode/2decode single cell.
decode_array/3
decode_record/3
encode/3
is_null/2Returns true if Value is a term representing NULL
new_codec/2
null/1Return the value that represents NULL (1st element of nulls list).
oid_to_decoder/3generate decoder to decode PG binary of datatype specified as OID.
oid_to_info/2
oid_to_name/2
supports/2
type_to_oid/2
typeinfo_to_name_array/2
typeinfo_to_oid_info/2
update_codec/2

Function Details

decode/2

decode(Bin::binary(), X2::decoder()) -> any()

decode single cell

decode_array/3

decode_array(X1, X2, ArrayDecoder) -> any()

decode_record/3

decode_record(X1, X2, Codec) -> any()

encode/3

encode(TypeName::epgsql:type_name() | {array, epgsql:type_name()}, Value::any(), Codec::codec()) -> iolist()

is_null/2

is_null(Value::any(), Codec::codec()) -> boolean()

Returns true if Value is a term representing NULL

new_codec/2

new_codec(PgSock::epgsql_sock:pg_sock(), Opts::opts()) -> codec()

null/1

null(Codec::codec()) -> any()

Return the value that represents NULL (1st element of nulls list)

oid_to_decoder/3

oid_to_decoder(Oid::epgsql_oid_db:oid(), Format::binary | text, Codec::codec()) -> decoder()

generate decoder to decode PG binary of datatype specified as OID

oid_to_info/2

oid_to_info(Oid::epgsql_oid_db:oid(), Codec::codec()) -> epgsql_oid_db:type_info() | undefined

oid_to_name/2

oid_to_name(Oid::epgsql_oid_db:oid(), Codec::codec()) -> maybe_unknown_type()

supports/2

supports(RecOid, Codec) -> any()

type_to_oid/2

type_to_oid(Name::type(), Codec::codec()) -> epgsql_oid_db:oid()

typeinfo_to_name_array/2

typeinfo_to_name_array(Unknown::Unknown | epgsql_oid_db:type_info(), X2::term()) -> Unknown | type()

typeinfo_to_oid_info/2

typeinfo_to_oid_info(Unknown::Unknown | epgsql_oid_db:type_info(), X2::term()) -> Unknown | epgsql_oid_db:oid_info()

update_codec/2

update_codec(TypeInfos::[epgsql_oid_db:type_info()], Codec::codec()) -> codec()


Generated by EDoc