Module epgsql_codec_hstore

Codec for hstore type.

Behaviours: epgsql_codec.

Description

Codec for hstore type.

Hstore codec can take a jiffy-style object or map() as input. Output format can be changed by providing return option. See return_format(). Values of hstore can be NULL. NULL representation can be changed by providing nulls option, semantics is similar to epgsql:connect_opts() nulls option.

XXX: hstore is not a part of postgresql builtin datatypes, it's in contrib. It should be enabled in postgresql by command CREATE EXTENSION hstore.

Data Types

data()

data() = data_in() | data_out()

data_in()

data_in() = {[{key_in(), binary()}]} | #{key_in() => binary() | atom()}

data_out()

data_out() = {[{Key::binary(), Value::binary()}]} | [{Key::binary(), Value::binary() | atom()}] | #{binary() => binary() | atom()}

map

key_in()

key_in() = list() | binary() | atom() | integer() | float()

options()

options() = #{return => return_format(), nulls => [atom(), ...]}

return_format()

return_format() = map | jiffy | proplist

Function Index

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

Function Details

decode/3

decode(X1, X2, St) -> any()

decode_text/3

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

encode/3

encode(Map, X2, St) -> any()

init/2

init(Opts0, X2) -> any()

names/0

names() -> any()


Generated by EDoc