package macaque

  1. Overview
  2. Docs

standard SQL operators (usable from user code, in pa_comp expressions)

val null : < t : < .. > ; nul : nullable ; get : unit > t
val nullable : < t : 't ; nul : non_nullable.. > t -> < t : 't ; nul : nullable > t
val is_null : < nul : nullable.. > t -> < t : bool_t ; nul : non_nullable > t
val is_not_null : < nul : nullable.. > t -> < t : bool_t ; nul : non_nullable > t
val of_option : < t : 't ; nul : non_nullable.. > t option -> < t : 't ; nul : nullable > t
type 'phant arith_op = 'phant binary_op constraint 'phant = < in_t : numeric_t as 't ; out_t : 't.. >
val (+) : _ arith_op
val (-) : _ arith_op
val (/) : _ arith_op
val (*) : _ arith_op
type 'phant comp_op = 'phant binary_op constraint 'phant = < out_t : bool_t.. >
val (<) : _ comp_op
val (<=) : _ comp_op
val (=) : _ comp_op
val (<>) : _ comp_op
val (>=) : _ comp_op
val (>) : _ comp_op
val is_distinct_from : < nul : 'n ; t : 't.. > t -> < nul : 'n ; t : 't.. > t -> < nul : non_nullable ; t : bool_t > t
val is_not_distinct_from : < nul : 'n ; t : 't.. > t -> < nul : 'n ; t : 't.. > t -> < nul : non_nullable ; t : bool_t > t
val in' : < nul : 'n ; t : 't.. > t -> < nul : 'n ; t : 't.. > t list -> < nul : 'n ; t : bool_t > t
type 'phant logic_op = 'phant binary_op constraint 'phant = < in_t : bool_t as 't ; out_t : 't.. >
val (&&) : _ logic_op
val (||) : _ logic_op
val not : < t : bool_t ; nul : 'n.. > t -> < t : bool_t ; nul : 'n > t
val count : _ group -> < t : int64_t ; nul : non_nullable > t

aggregate functions

val min : < t : numeric_t as 't ; nul : 'n.. > group -> < t : 't ; nul : nullable > t
val max : < t : numeric_t as 't ; nul : 'n.. > group -> < t : 't ; nul : nullable > t
val sum : < t : numeric_t as 't ; nul : 'n.. > group -> < t : 't ; nul : nullable > t
val md5 : < t : string_t ; nul : 'n.. > group -> < t : string_t ; nul : 'n > t
val nextval : 'a sequence -> < t : 'a ; nul : non_nullable > t

sequence functions

val currval : 'a sequence -> < t : 'a ; nul : non_nullable > t
val current_timestamp : < t : unit_t.. > t -> < t : timestamptz_t ; nul : _ > t

timestamp

val localtimestamp : < t : unit_t.. > t -> < t : timestamp_t ; nul : _ > t