Current section
Files
Jump to
Current section
Files
src/glsql@internal@dialect@postgres.erl
-module(glsql@internal@dialect@postgres).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/glsql/internal/dialect/postgres.gleam").
-export([builtin_types/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.
?MODULEDOC(false).
-file("src/glsql/internal/dialect/postgres.gleam", 126).
?DOC(false).
-spec time_of_day() -> glsql@internal@mapping:type_mapping().
time_of_day() ->
{type_mapping,
<<"calendar.TimeOfDay"/utf8>>,
<<"pog.calendar_time_of_day_decoder()"/utf8>>,
<<"pog.calendar_time_of_day($)"/utf8>>,
[<<"gleam/time/calendar"/utf8>>]}.
-file("src/glsql/internal/dialect/postgres.gleam", 117).
?DOC(false).
-spec date() -> glsql@internal@mapping:type_mapping().
date() ->
{type_mapping,
<<"calendar.Date"/utf8>>,
<<"pog.calendar_date_decoder()"/utf8>>,
<<"pog.calendar_date($)"/utf8>>,
[<<"gleam/time/calendar"/utf8>>]}.
-file("src/glsql/internal/dialect/postgres.gleam", 108).
?DOC(false).
-spec timestamp() -> glsql@internal@mapping:type_mapping().
timestamp() ->
{type_mapping,
<<"timestamp.Timestamp"/utf8>>,
<<"pog.timestamp_decoder()"/utf8>>,
<<"pog.timestamp($)"/utf8>>,
[<<"gleam/time/timestamp"/utf8>>]}.
-file("src/glsql/internal/dialect/postgres.gleam", 63).
?DOC(false).
-spec text() -> glsql@internal@mapping:type_mapping().
text() ->
{type_mapping,
<<"String"/utf8>>,
<<"decode.string"/utf8>>,
<<"pog.text($)"/utf8>>,
[]}.
-file("src/glsql/internal/dialect/postgres.gleam", 135).
?DOC(false).
-spec bit_array() -> glsql@internal@mapping:type_mapping().
bit_array() ->
{type_mapping,
<<"BitArray"/utf8>>,
<<"decode.bit_array"/utf8>>,
<<"pog.bytea($)"/utf8>>,
[]}.
-file("src/glsql/internal/dialect/postgres.gleam", 99).
?DOC(false).
-spec numeric() -> glsql@internal@mapping:type_mapping().
numeric() ->
{type_mapping,
<<"Float"/utf8>>,
<<"pog.numeric_decoder()"/utf8>>,
<<"pog.float($)"/utf8>>,
[]}.
-file("src/glsql/internal/dialect/postgres.gleam", 81).
?DOC(false).
-spec float() -> glsql@internal@mapping:type_mapping().
float() ->
{type_mapping,
<<"Float"/utf8>>,
<<"decode.float"/utf8>>,
<<"pog.float($)"/utf8>>,
[]}.
-file("src/glsql/internal/dialect/postgres.gleam", 90).
?DOC(false).
-spec bool() -> glsql@internal@mapping:type_mapping().
bool() ->
{type_mapping,
<<"Bool"/utf8>>,
<<"decode.bool"/utf8>>,
<<"pog.bool($)"/utf8>>,
[]}.
-file("src/glsql/internal/dialect/postgres.gleam", 72).
?DOC(false).
-spec int() -> glsql@internal@mapping:type_mapping().
int() ->
{type_mapping,
<<"Int"/utf8>>,
<<"decode.int"/utf8>>,
<<"pog.int($)"/utf8>>,
[]}.
-file("src/glsql/internal/dialect/postgres.gleam", 16).
?DOC(false).
-spec builtin_types() -> gleam@dict:dict(binary(), glsql@internal@mapping:type_mapping()).
builtin_types() ->
maps:from_list(
[{<<"text"/utf8>>, text()},
{<<"varchar"/utf8>>, text()},
{<<"character varying"/utf8>>, text()},
{<<"char"/utf8>>, text()},
{<<"citext"/utf8>>, text()},
{<<"uuid"/utf8>>, text()},
{<<"int2"/utf8>>, int()},
{<<"smallint"/utf8>>, int()},
{<<"int4"/utf8>>, int()},
{<<"int"/utf8>>, int()},
{<<"integer"/utf8>>, int()},
{<<"int8"/utf8>>, int()},
{<<"bigint"/utf8>>, int()},
{<<"serial"/utf8>>, int()},
{<<"bigserial"/utf8>>, int()},
{<<"smallserial"/utf8>>, int()},
{<<"bool"/utf8>>, bool()},
{<<"boolean"/utf8>>, bool()},
{<<"float4"/utf8>>, float()},
{<<"real"/utf8>>, float()},
{<<"float8"/utf8>>, float()},
{<<"double precision"/utf8>>, float()},
{<<"numeric"/utf8>>, numeric()},
{<<"decimal"/utf8>>, numeric()},
{<<"json"/utf8>>, text()},
{<<"jsonb"/utf8>>, text()},
{<<"bytea"/utf8>>, bit_array()},
{<<"tsvector"/utf8>>, text()},
{<<"inet"/utf8>>, text()},
{<<"cidr"/utf8>>, text()},
{<<"macaddr"/utf8>>, text()},
{<<"timestamp"/utf8>>, timestamp()},
{<<"timestamptz"/utf8>>, timestamp()},
{<<"timestamp with time zone"/utf8>>, timestamp()},
{<<"timestamp without time zone"/utf8>>, timestamp()},
{<<"date"/utf8>>, date()},
{<<"time"/utf8>>, time_of_day()},
{<<"time without time zone"/utf8>>, time_of_day()}]
).