Datatypes

View Source

Gel client for Elixir automatically converts Gel types to the corresponding Elixir types and vice versa.

The table below shows the correspondence between Gel and Elixir types.

GelElixirExample
std::strString.t/0"Hello Gel!"
std::int16, std::int32, std::int64integer/016
std::float32, std::float64float/03.1415
std::bigint, std::decimalDecimal.t/0#Decimal<1.23>
std::boolboolean/0true, false
std::datetimeDateTime.t/0~U[2018-05-07 15:01:22Z]
std::durationinteger/0 or Timex.Duration-420000000, #<Duration(PT7M)>
cal::local_datetimeNaiveDateTime.t/0~N[2018-05-07 15:01:22]
cal::local_dateDate.t/0~D[2018-05-07]
cal::local_timeTime.t/0~T[15:01:22]
cal::relative_durationGel.RelativeDuration.t/0#Gel.RelativeDuration<"PT45.6S">
cal::date_durationGel.DateDuration.t/0#Gel.DateDuration<"P4Y12D">
std::jsonany/042
std::uuidString.t/0"0eba1636-846e-11ec-845e-276b0105b857"
std::bytesbinary/0<<1, 2, 3>>, "some bytes"
cfg::memoryGel.ConfigMemory.t/0#Gel.ConfigMemory<"5KiB">
ext::pgvector::vectorlist/0[1.5, 2.0, 4.5]
anyenumString.t/0"green"
array<anytype>list/0[1, 2, 3]
anytupletuple/0 or Gel.NamedTuple.t/0{1, 2, 3}, #Gel.NamedTuple<a: 1, b: 2, c: 3>}
rangeGel.Range.t/0#Gel.Range<[1.1, 3.3)>
objectGel.Object.t/0#Gel.Object<name := "username">}
setGel.Set.t/0#Gel.Set<{1, 2, 3}>}