Repodb.Json

repodb · API reference

Backend-specific JSON query helpers.

PostgreSQL, SQLite, and MariaDB/MySQL have overlapping support, but JSON semantics are still backend-specific and should not be treated as portable.

type path_elem = Expr.json_path_elem
type path = Expr.json_path
type extract_mode = Expr.json_extract_mode
val key : string -> Expr.json_path_elem
val idx : int -> Expr.json_path_elem
val path : string list -> Expr.json_path_elem list
val get : ('a, string) Field.t -> Expr.json_path -> string Expr.t
val get_text : ('a, string) Field.t -> Expr.json_path -> string Expr.t
val eq : string -> 'a Expr.t -> bool Expr.t
val neq : string -> 'a Expr.t -> bool Expr.t
val is_null : 'a Expr.t -> bool Expr.t
val is_not_null : 'a Expr.t -> bool Expr.t
val contains : ('a, string) Field.t -> string -> bool Expr.t
val contained_by : ('a, string) Field.t -> string -> bool Expr.t
val has_key : ('a, string) Field.t -> string -> bool Expr.t
val has_path : ('a, string) Field.t -> Expr.json_path -> bool Expr.t
val has_any_keys : ('a, string) Field.t -> string list -> bool Expr.t
val has_all_keys : ('a, string) Field.t -> string list -> bool Expr.t
val array_length : ('a, string) Field.t -> int Expr.t
val array_length_at : ('a, string) Field.t -> Expr.json_path -> int Expr.t
type json_type = 
  | Object
  | Array
  | String
  | Number
  | Boolean
  | Null
val typeof : ('a, string) Field.t -> string Expr.t
val typeof_at : ('a, string) Field.t -> Expr.json_path -> string Expr.t