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 --- lib/configuration/graph_tree.ml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/configuration/graph_tree.ml') diff --git a/lib/configuration/graph_tree.ml b/lib/configuration/graph_tree.ml index 25c9366..240c1c9 100644 --- a/lib/configuration/graph_tree.ml +++ b/lib/configuration/graph_tree.ml @@ -9,9 +9,13 @@ module Vertex = struct type t = Model.Reference.t Model.Content.t - let compare t1 t2 = String.compare (Model.Content.id t1) (Model.Content.id t2) - let equal t1 t2 = String.equal (Model.Content.id t1) (Model.Content.id t2) - let hash t = Hashtbl.hash (Model.Content.id t) + let compare t1 t2 = + Model.Identifier.compare (Model.Content.id t1) (Model.Content.id t2) + + let equal t1 t2 = + Model.Identifier.equal (Model.Content.id t1) (Model.Content.id t2) + + let hash t = Model.Identifier.hash (Model.Content.id t) end module Edge = struct @@ -20,7 +24,7 @@ module Edge = struct let compare e1 e2 = match (e1, e2) with | Field f1, Field f2 -> - String.compare (Model.Field.name f1) (Model.Field.name f2) + Model.Identifier.compare (Model.Field.name f1) (Model.Field.name f2) | Default, Default -> 0 | _, _ -> Stdlib.compare e1 e2 @@ -33,7 +37,7 @@ module GV_Printer = Graph.Graphviz.Dot (struct include G let graph_attributes _ = [] - let vertex_name v = Model.Content.id v + let vertex_name v = Model.Identifier.to_string (Model.Content.id v) let vertex_attributes _ = [] let default_vertex_attributes _ = [] let edge_attributes _ = [] -- cgit v1.2.3