Current section
Files
Jump to
Current section
Files
src/postgleam@codec@defaults.erl
-module(postgleam@codec@defaults).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/postgleam/codec/defaults.gleam").
-export([matchers/0, build_registry/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/postgleam/codec/defaults.gleam", 43).
?DOC(" Returns the default list of codec matchers\n").
-spec matchers() -> list(postgleam@codec:codec_matcher()).
matchers() ->
[postgleam@codec@bool:matcher(),
postgleam@codec@int2:matcher(),
postgleam@codec@int4:matcher(),
postgleam@codec@int8:matcher(),
postgleam@codec@float4:matcher(),
postgleam@codec@float8:matcher(),
postgleam@codec@text:matcher(),
postgleam@codec@bytea:matcher(),
postgleam@codec@uuid:matcher(),
postgleam@codec@oid_codec:matcher(),
postgleam@codec@name:matcher(),
postgleam@codec@void:matcher(),
postgleam@codec@date:matcher(),
postgleam@codec@time:matcher(),
postgleam@codec@timetz:matcher(),
postgleam@codec@timestamp:matcher(),
postgleam@codec@timestamptz:matcher(),
postgleam@codec@interval:matcher(),
postgleam@codec@json:matcher(),
postgleam@codec@jsonb:matcher(),
postgleam@codec@numeric:matcher(),
postgleam@codec@point:matcher(),
postgleam@codec@inet:matcher(),
postgleam@codec@macaddr:matcher(),
postgleam@codec@macaddr8:matcher(),
postgleam@codec@money:matcher(),
postgleam@codec@xml:matcher(),
postgleam@codec@jsonpath:matcher(),
postgleam@codec@bit_string:matcher(),
postgleam@codec@line:matcher(),
postgleam@codec@lseg:matcher(),
postgleam@codec@box:matcher(),
postgleam@codec@path:matcher(),
postgleam@codec@polygon:matcher(),
postgleam@codec@circle:matcher()].
-file("src/postgleam/codec/defaults.gleam", 86).
?DOC(
" Build the full registry including scalar codecs and array codecs.\n"
" Array codecs are post-registered because they need element codecs\n"
" from the base registry.\n"
).
-spec build_registry() -> gleam@dict:dict(integer(), postgleam@codec:codec()).
build_registry() ->
Base = postgleam@codec@registry:build(matchers()),
postgleam@codec@array:register_arrays(Base).