From 056fcabaeec238a7aa927df39a90acea028b1aa0 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 22 Nov 2026 13:58:16 +0100 Subject: Added an option for loading a value content without the multivaluated fields (allow single query) --- test/load.ml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'test/load.ml') diff --git a/test/load.ml b/test/load.ml index ebc4e15..e992e32 100644 --- a/test/load.ml +++ b/test/load.ml @@ -2,8 +2,9 @@ let name = __FILE__ let description = "Insert two rows of the given content, load them as values with [Value.load] \ - and print them with [Value.pp]. The configuration is read on the standard \ - input" + and print them with [Value.pp]; then load the first row again with \ + [~multivalued:false], which reads only the row itself. The configuration is \ + read on the standard input" let speclist () = [] @@ -30,7 +31,20 @@ let exec : string list -> t = function Lwt.return [ Format.sprintf "row %Ld:" id; Format.asprintf "%a" Value.pp v ] in + let load_one_partial id = + let* v = + Value.load db ~multivalued:false + (Model.Reference.of_content content) + id + in + Lwt.return + [ + Format.sprintf "row %Ld (without multivalued fields):" id; + Format.asprintf "%a" Value.pp v; + ] + in let* lines1 = load_one id1 in let* lines2 = load_one id2 in - Lwt.return (lines1 @ lines2)) + let* lines3 = load_one_partial id1 in + Lwt.return (lines1 @ lines2 @ lines3)) | _ -> failwith "Invalid arguments" -- cgit v1.2.3