Module Row.Quick

Quick row specification syntax for query results.

These functions contructs rows with columns that have no parameters and a default projection Col.no_proj. They can be used to quickly type SQL statement results.

WARNING. Since by default these column constructors lack projection Row.pp cannot be used on them. Those created with tuple constructors do however (re)define projection.

val unit : 'a -> ('r'a) prod

unit is Row.unit.

val (*) : ('r'a -> 'b) prod -> ('r'a) Col.t -> ('r'b) prod

( * ) is Row.prod.

val bool : ?proj:('r -> bool) -> string -> ('r, bool) Col.t

bool n is a boolean column named n.

val int : ?proj:('r -> int) -> string -> ('r, int) Col.t

int n is an integer column named n.

val int64 : ?proj:('r -> int64) -> string -> ('r, int64) Col.t

int64 n is an 64-bit integer column named n.

val float : ?proj:('r -> float) -> string -> ('r, float) Col.t

float n is a float column named n.

val text : ?proj:('r -> string) -> string -> ('r, string) Col.t

text is a text column named n.

val blob : ?proj:('r -> string) -> string -> ('r, string) Col.t

blob is a blob column named n.

val option : ?proj:('r -> 'a option) -> 'a Type.t -> string -> ('r'a option) Col.t

option t n is a nullable t column named n.

Tuple constructors

val t1 : (_'a) Col.t -> 'a t

t1 construct and deconstructs values with the given column. This redefines the projection to the identity.

val t2 : (_'a) Col.t -> (_'b) Col.t -> ('a * 'b) t

t2 constructs and deconstructs pairs with the given column types. This redefine the projections of the columns.

val t3 : (_'a) Col.t -> (_'b) Col.t -> (_'c) Col.t -> ('a * 'b * 'c) t

t3 constructs and deconstructs triplets with the given column types. This redefine the projections of the columns.

val t4 : (_'a) Col.t -> (_'b) Col.t -> (_'c) Col.t -> (_'d) Col.t -> ('a * 'b * 'c * 'd) t

t4 constructs and deconstructs quadruplets with the given column types. This redefine the projections of the columns.

val t5 : (_'a) Col.t -> (_'b) Col.t -> (_'c) Col.t -> (_'d) Col.t -> (_'e) Col.t -> ('a * 'b * 'c * 'd * 'e) t

t5 constructs and deconstructs quintuplets with the given column types. This redefine the projections of the columns.