From 62123e577ee5d4066d53f8ad7e5ac3d2eb190430 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 18 Nov 2026 20:24:52 +0100 Subject: Securized the queries in the database with a dedicated type for the Identifiers --- test/insert.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/insert.ml') diff --git a/test/insert.ml b/test/insert.ml index bc65422..451d857 100644 --- a/test/insert.ml +++ b/test/insert.ml @@ -35,7 +35,7 @@ let insert_and_get_result : Query.insert ?parent db content (fun v -> match List.assoc_opt v entry with Some v -> v | None -> Model.Typ.None) in - let content_id = Model.Content.id content in + let content_id = Model.Identifier.to_string (Model.Content.id content) in let module Db = (val db) in let* json_result = Db.find (Common.content_as_json content) id in let* json = Caqti_lwt.or_fail json_result in @@ -144,7 +144,7 @@ module Make (S : Decoders.Decode.S) = struct [ ( "content", fun v -> - match (Configuration.Ast.get_content conf) key with + match (Configuration.Ast.get_content conf) (Model.Identifier.of_string key) with | None -> Error (Decoders.Error.make "no content") | Some subcontent -> let values = self#values subcontent v in @@ -172,7 +172,7 @@ module Make (S : Decoders.Decode.S) = struct fun name -> (* In this syntax, the content is supposed to follow the definition and will never be None *) - let content = Configuration.Ast.get_content conf name |> Option.get in + let content = Configuration.Ast.get_content conf (Model.Identifier.of_string name) |> Option.get in let* properties = S.field_opt_or ~default:(Lwt.return []) "values" (self#values content) -- cgit v1.2.3