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/query/encoder.ml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lib/query/encoder.ml') diff --git a/lib/query/encoder.ml b/lib/query/encoder.ml index 6897ec7..5ee6727 100644 --- a/lib/query/encoder.ml +++ b/lib/query/encoder.ml @@ -271,10 +271,13 @@ module InsertTableName = Map (struct let f : type a. unit -> a data -> a t = fun () -> function - | { name = column; content_type = Text; _ } -> column - | { name = column; content_type = Integer; _ } -> column - | { name = column; content_type = MultiReference _; _ } -> column - | { name = column; content_type = MonoReference _; _ } -> column + | { name = column; content_type = Text; _ } -> Model.Identifier.quote column + | { name = column; content_type = Integer; _ } -> + Model.Identifier.quote column + | { name = column; content_type = MultiReference _; _ } -> + Model.Identifier.quote column + | { name = column; content_type = MonoReference _; _ } -> + Model.Identifier.quote column include ConcatParam end) @@ -292,7 +295,7 @@ module DataToCaqtiValues = Map (struct let f : type a. env -> a Intf.data -> a t = fun provider Intf.{ name; content_type } -> - let result = provider name in + let result = provider (Model.Identifier.to_string name) in (* Check the value given by the provider and ensure it’s match the expected type *) match result with -- cgit v1.2.3