Something went wrong. Try again.
SQL frontend over the catalog engine
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940(*--------------------------------------------------------------------------- Copyright (c) 2026 Thomas Gazagnaire. All rights reserved. SPDX-License-Identifier: ISC ---------------------------------------------------------------------------*)
(** The element types of JSONB (jsonb.html, section 3): the closed set of node categories the format has. *)
type t = | Null (** NULL, type 0: JSON [null]. *) | True (** TRUE, type 1. *) | False (** FALSE, type 2. *) | Int (** INT, type 3: an RFC 8259 integer, its text the payload. *) | Int5 (** INT5, type 4: a JSON5 integer, such as a hexadecimal one. *) | Float (** FLOAT, type 5: an RFC 8259 real, its text the payload. *) | Float5 (** FLOAT5, type 6: a JSON5 real, such as [.5] or [5.]. *) | Text (** TEXT, type 7: a string that needs no escape. *) | Textj (** TEXTJ, type 8: a string holding RFC 8259 escapes. *) | Text5 (** TEXT5, type 9: a string holding JSON5 escapes. *) | Textraw (** TEXTRAW, type 10: a string to escape on output. *) | Array (** ARRAY, type 11: its elements, one after the other. *) | Object (** OBJECT, type 12: label and value elements in turn. *)
val of_code : int -> t option(** [of_code c] is the element type whose code is [c], or [None] for the reserved codes 13 to 15 and any other. *)
val to_code : t -> int(** [to_code s] is the code of [s], the low four bits of its header. *)
val to_string : t -> string(** [to_string s] is the lowercase name jsonb.html gives [s]: ["null"], ["int5"], ["textraw"] and so on. *)
val equal : t -> t -> bool(** [equal a b] is [true] iff [a] and [b] are the same type. *)
val pp : t Fmt.t(** [pp] formats a type as {!to_string} does. *)