Module Ask.Table

Table descriptions.

Tables simply give a name to rows.


type param = ..

The type for exensible table parameters. See Parameters.

type 'r t = {
name : string;
params : param list;
row : 'r Row.t Stdlib.Lazy.t;

The type for a table represented by an OCaml of type 'a. Unless you get into recursive trouble, use the constructor v.

type v =
| V : 'r t -> v(*

The type for existential tables.

val v : ?params:param list -> string -> 'r Row.t -> 'r t

v name ~params r is a table with corresponding attributes.

val name : 'r t -> string

name t is the name of t.

val params : 'r t -> param list

name t are the parameters of t.

val row : 'r t -> 'r Row.t

row t is the description of t's rows.

val cols : ?ignore:'r Col.v list -> 'r t -> 'r Col.v list

cols t is Row.cols (row t) with columns in ignore ommited from the result.


See Ask.Sql for more parameters.

type param +=
| Primary_key : 'r Col.v list -> param
| Foreign_key : 'r Col.v list * ('s t * 's Col.v list) -> param

Common table parameters.

  • Primary_key cols, declares a table primary key on columns cols
  • Foreign_key (cols, (t, cols')) declares a foreign key between cols and the columns cols' of t. Can be repeated.