Ask.Col
Column descriptions.
Columns are tupled into rows. A column is defined by its name, its type and how to project it from an OCaml value representing a row.
TODO.
The type for extensible column parameters. See Parameters.
FIXME. Add columns parameters like we did for Table.param
. For now it oddly breaks compilation.
The type for a column of type 'a
which is part of a row stored in an OCaml value of type 'r
. Unless you get into recursive trouble use constructor v
.
The type for a column value for a row of type 'r
.
v name t proj ~params
is a column named name
with type t
, row projection function proj
and parameters params
(defaults to []
).
val name : ('r, 'a) t -> string
name c
is the name of c
.
val proj : ('r, 'a) t -> 'r -> 'a
proj c
is the projection function of c
.
equal_name c0 c1
is true
if c0
and c1
have the same name.
See Ask.Sql
for more parameters.
val pp : Stdlib.Format.formatter -> ('r, 'a) t -> unit
pp
formats column descriptions.
val pp_name : Stdlib.Format.formatter -> ('r, 'a) t -> unit
pp_name
formats the column name.
val value_pp : ('r, 'a) t -> Stdlib.Format.formatter -> 'r -> unit
value_pp
formats a row's column value.
val pp_value : Stdlib.Format.formatter -> 'r value -> unit
pp_value ppf v
formats v
's value.