gloo/value
Adapter-agnostic parameter value type.
Use these constructors in sql and query modules — they are encoded
to DB-specific wire types by the adapter at execution time.
Types
pub type GlooValue {
GString(String)
GInt(Int)
GFloat(Float)
GBool(Bool)
GBitArray(BitArray)
GTimestamp(timestamp.Timestamp)
GNull
GArray(List(GlooValue))
GStringArray(List(String))
GIntArray(List(Int))
}
Constructors
-
GString(String) -
GInt(Int) -
GFloat(Float) -
GBool(Bool) -
GBitArray(BitArray) -
GTimestamp(timestamp.Timestamp) -
GNull -
GArray(List(GlooValue))Postgres-only: used for UNNEST / array parameters. SQLite adapter will return DbError if this is encountered.
-
GStringArray(List(String))Postgres text[] — use with = ANY($N) or UNNEST. SQLite adapter will return DbError; use manual IN (?,?,?) instead.
-
GIntArray(List(Int))Postgres int8[] — use with = ANY($N) or UNNEST. SQLite adapter will return DbError; use manual IN (?,?,?) instead.
Values
pub fn nullable(
encoder: fn(a) -> GlooValue,
v: option.Option(a),
) -> GlooValue