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/update.ml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/update.ml') diff --git a/test/update.ml b/test/update.ml index 1e94fc2..6f22466 100644 --- a/test/update.ml +++ b/test/update.ml @@ -67,11 +67,11 @@ let configuration = let speclist () = let (lazy configuration) = configuration in - let content = Configuration.Ast.get_content configuration "entity" in + let content = Configuration.Ast.get_content configuration (Model.Identifier.of_string "entity") in let fields = Model.Content.fields (Option.get content) in Seq.fold_left (fun acc feature -> - let key = "--" ^ Model.Field.name feature in + let key = "--" ^ Model.Identifier.to_string (Model.Field.name feature) in let (Model.Field.T type_) = Model.Field.type_ feature in let argument = match type_ with @@ -81,7 +81,7 @@ let speclist () = Arg.String (fun value -> actions := - Text (Model.Field.name feature, value) :: !actions), + Text (Model.Identifier.to_string (Model.Field.name feature), value) :: !actions), " Set field with the value " ) | Model.Typ.Integer -> Some @@ -89,7 +89,7 @@ let speclist () = Arg.Int (fun value -> actions := - Integer (Model.Field.name feature, value) :: !actions), + Integer (Model.Identifier.to_string (Model.Field.name feature), value) :: !actions), " Set field with the value " ) | Model.Typ.MonoReference target -> Some @@ -97,7 +97,7 @@ let speclist () = Arg.Int (fun value -> actions := - Reference (target, Model.Field.name feature, value) + Reference (target, Model.Identifier.to_string (Model.Field.name feature), value) :: !actions), " Set field with the id" ) | Model.Typ.MultiReference target -> @@ -112,7 +112,7 @@ let speclist () = in actions := - References (target, Model.Field.name feature, ids) + References (target, Model.Identifier.to_string (Model.Field.name feature), ids) :: !actions), " Set this list of values" ) in @@ -133,7 +133,7 @@ let exec : string list -> t = fun _ -> let (lazy configuration) = configuration in let content = - Configuration.Ast.get_content configuration "entity" |> Option.get + Configuration.Ast.get_content configuration (Model.Identifier.of_string "entity") |> Option.get in Lwt_main.run @@ -162,7 +162,7 @@ let exec : string list -> t = let field = Model.Content.fields content |> Seq.find (fun f -> - String.equal key (Model.Field.name f)) + String.equal key (Model.Identifier.to_string (Model.Field.name f))) |> Option.get in let (Model.Field.T t) = Model.Field.type_ field in -- cgit v1.2.3