diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-11-18 20:24:52 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-11-18 21:57:48 +0100 |
| commit | 62123e577ee5d4066d53f8ad7e5ac3d2eb190430 (patch) | |
| tree | f569686630681a9eceb2685f69b55fe5a2bac17c /lib/query/encoder.ml | |
| parent | 7087a0c2c84e796e474784cbd28d4a4e574cf2c0 (diff) | |
Securized the queries in the database with a dedicated type for the Identifiers
Diffstat (limited to 'lib/query/encoder.ml')
| -rw-r--r-- | lib/query/encoder.ml | 13 |
1 files changed, 8 insertions, 5 deletions
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 |
