package macaque

  1. Overview
  2. Docs
type untyped
type 'a writable
type non_writable
type nullable
type non_nullable
type 'n nul_witness
val nullable_witness : nullable nul_witness
val non_nullable_witness : non_nullable nul_witness
class type !'t type_info = object ... end
class type numeric_t = object ... end
class type unit_t = object ... end
class type bool_t = object ... end
class type int16_t = object ... end
class type int32_t = object ... end
class type int64_t = object ... end
class type float_t = object ... end
class type string_t = object ... end
class type bytea_t = object ... end
class type time_t = object ... end
class type date_t = object ... end
class type timestamp_t = object ... end
class type timestamptz_t = object ... end
class type interval_t = object ... end
class type int32_array_t = object ... end
class type !'row row_t = object ... end
type !'t type_info_only = < t : 't type_info >
type +'a t
val untyped_t : 'a t -> untyped t
type 'c binary_op = < nul : 'n ; t : 'in_t.. > as 'a t -> < nul : 'n ; t : 'in_t.. > as 'b t -> < nul : 'n ; t : 'out_t > t constraint 'c = < a : 'a ; b : 'b ; in_t : 'in_t ; nul : 'n ; out_t : 'out_t >
type 'a nullable_data = < get : unit ; nul : nullable ; t : 'a > t
type 'a non_nullable_data = < get : unit ; nul : non_nullable ; t : 'a > t
type +'a unsafe
val unsafe : 'a -> 'a unsafe
type +'a sql_type
val untyped_type : 'a sql_type -> untyped sql_type
val recover_type : 'a sql_type -> untyped sql_type unsafe -> 'a sql_type
val get_type : < nul : 'nul ; t : 't.. > t -> < get : unit ; nul : 'nul ; t : 't > sql_type
val cast : < nul : 'nul ; t : 't.. > as 'b t -> < nul : 'nul ; t : 't.. > sql_type -> 'b t
type !'a result_parser = (string array * int Pervasives.ref) -> 'a
type !'a record_parser = untyped sql_type Sql_base.tuple -> 'a result_parser
val get : < get : 'a ; nul : non_nullable ; t : 't type_info > t -> 't
val getn : < get : 'a ; nul : nullable ; t : 't type_info > t -> 't option
val parse : 'a sql_type -> 'a t result_parser
type (+'a, 'w) view
val untyped_view : ('a, 'w) view -> (untyped, untyped) view
val field : < nul : non_nullable ; t : 'a row_t.. > t -> string list unsafe -> (row:'a -> < nul : 'n ; t : 't.. > t) unsafe -> < nul : 'n ; t : 't > t
val default : ('a, 'def writable) view -> string unsafe -> (default_fields:'def -> < nul : 'n ; t : 't.. > t) unsafe -> < nul : 'n ; t : 't > t
val row : string unsafe -> ('a, 'b) view -> < nul : non_nullable ; t : < typ : 'a > > t
val tuple : untyped t Sql_base.tuple unsafe -> (tuple:'tup -> untyped t Sql_base.tuple) unsafe -> 'tup record_parser unsafe -> < nul : non_nullable ; t : < typ : 'tup > > t
val if_then_else : < t : bool_t.. > t -> < a : < nul : 'a ; t : 't.. > ; b : < nul : 'a ; t : 't.. > ; in_t : 't ; nul : 'a ; out_t : 't > binary_op
val match_null : < nul : nullable ; t : 't.. > t -> < nul : 'res_n ; t : 'res_t.. > t -> (< nul : non_nullable ; t : 't.. > t -> < nul : 'res_n ; t : 'res_t.. > t) -> < nul : 'res_n ; t : 'res_t > t
type +'a result constraint 'a = < .. >
val simple_select : < t : 'b as 'a row_t.. > t -> 'a result
type where = < t : bool_t > t list
type order =
  1. | Asc
  2. | Desc
val view : 'b as 'a result -> ?order_by:(untyped t * order) list -> ?limit:< t : numeric_t.. > t -> ?offset:< t : numeric_t.. > t -> from -> where -> ('a, non_writable) view
type grouped_row
val grouped_row : grouped_row
type +'a group
type +'a accum
val accum : 'a t -> 'a accum
val group_of_accum : 'a accum -> 'a group
val group : < t : 'const row_t.. > t -> < t : 'b as 'a row_t.. > t -> 'a result
val table : untyped sql_type Sql_base.tuple -> (row:'row -> untyped t Sql_base.tuple) unsafe -> 'row record_parser -> (string option * string) -> ('def * untyped t Sql_base.tuple) -> ('row, 'def writable) view
module Table_type : sig ... end
type +'a query
val select : ('a, 'b) view -> 'a list query
val insert : ('a, 'b writable) view -> ('a, 'c) view -> unit query
val delete : ('a, 'b writable) view -> string unsafe -> from -> where -> unit query
val update : ('a, 'c writable) view -> string unsafe -> 'b t -> bool unsafe -> from -> where -> unit query
val value : < nul : 'nul ; t : 't.. > t -> < get : unit ; nul : 'nul ; t : 't > t query
val sql_of_query : 'a query -> string
val sql_of_view : ('a, 'b) view -> string
val handle_query_results : 'a query -> string array list unsafe -> 'a
module Value : sig ... end
type 'a sequence
module Sequence : sig ... end
module Op : sig ... end
module View : sig ... end
module ViewOp : sig ... end
val break : 'a t -> Sql_internals.value
val break_view : ('a, 'b) view -> Sql_internals.view
OCaml

Innovation. Community. Security.