SagaPgo.Types
Types
Value
opaque type ValueUuid
opaque type UuidA Postgres UUID. Internally a 36-character canonical hyphenated string.
Values
naive_datetime
fun naive_datetime : Decoder NaiveDateTimeDecoder for Postgres TIMESTAMP and TIMESTAMPTZ columns. Both are decoded to a NaiveDateTime in UTC.
uuid
fun uuid : Decoder UuidDecoder for Postgres UUID columns.
Functions
pg_null
fun pg_null : Unit -> Valuepg_int
fun pg_int : Int -> Valuepg_float
fun pg_float : Float -> Valuepg_text
fun pg_text : String -> Valuepg_bool
fun pg_bool : Bool -> Valuepg_uuid
fun pg_uuid : Uuid -> ValueEncode a Uuid as a query parameter.
pg_date
fun pg_date : Date -> ValueEncode a Date as a query parameter for Postgres DATE columns.
maybe_null
fun maybe_null : a -> Value -> Maybe a -> ValueEncode an optional value as a query parameter, emitting NULL when the
value is Nothing. Takes an encoder function so it composes with any
value encoder:
maybe_null text maybe_username maybe_null int_value maybe_age maybe_null date_value maybe_birthday
parse_uuid
fun parse_uuid : String -> Result Uuid StringParse a string into a Uuid. Accepts canonical hyphenated form.