summaryrefslogtreecommitdiff
path: root/lib/configuration/graph_tree.ml
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-11-18 20:24:52 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-11-18 21:57:48 +0100
commit62123e577ee5d4066d53f8ad7e5ac3d2eb190430 (patch)
treef569686630681a9eceb2685f69b55fe5a2bac17c /lib/configuration/graph_tree.ml
parent7087a0c2c84e796e474784cbd28d4a4e574cf2c0 (diff)
Securized the queries in the database with a dedicated type for the Identifiers
Diffstat (limited to 'lib/configuration/graph_tree.ml')
-rw-r--r--lib/configuration/graph_tree.ml14
1 files changed, 9 insertions, 5 deletions
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 _ = []