package sqlgg

  1. Overview
  2. Docs
SQL Guided (code) Generator

Install

dune-project
 Dependency

Authors

Maintainers

Sources

sqlgg-20260721.tbz
sha256=40d7699187951dd2f17d885c4f4f04124930bf7dc1119d4cca322c5f0cb42d8e
sha512=e7c90683cddcff3ca0ba9de9e40c2c4c69923ea62e2647f1a70083e42ed00b7cab53f8a14d1a965ee4465966bc02fa75fa7cb42e485beae1a9c26bdc252c3665

doc/src/sqlgg.traits/sqlgg_trait_types.ml.html

Source file sqlgg_trait_types.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
type json = [
  | `Null
  | `Bool of bool
  | `Float of float
  | `String of string
  | `Assoc of (string * json) list
  | `List of json list
  | `Int of int
  | `Intlit of string
]

type json_path = Sqlgg_json_path.Ast.t
type one_or_all = [ `One | `All ]

 let rec convert_json = function
  | (`Null | `Bool _ | `Int _ | `Intlit _ | `Float _ | `String _) as x -> x
  | `Assoc assoc_list ->
    let convert_pair (key, value) = (key, convert_json value) in
    `Assoc (List.map convert_pair assoc_list)
  | `List json_list | `Tuple json_list ->
    `List (List.map convert_json json_list)
  | `Variant _ -> failwith "Variant type is not supported"