From b05e2d2be7be28ee6c577671002797cf9abaf177 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 20 Nov 2026 16:23:53 +0100 Subject: New module for working with Values --- lib/configuration/read_conf.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/configuration/read_conf.ml') diff --git a/lib/configuration/read_conf.ml b/lib/configuration/read_conf.ml index 14ee0b7..67703da 100644 --- a/lib/configuration/read_conf.ml +++ b/lib/configuration/read_conf.ml @@ -92,7 +92,16 @@ module Make (S : Decoders.Decode.S) = struct S.succeed Model.Field.{ rule; message } let field (env : env) : Model.field S.decoder = - let* name = S.field "name" identifier + let* name = + S.field "name" + (S.and_then + (fun name -> + if Model.Identifier.equal name Model.Identifier.id then + S.fail + "the name \"id\" is reserved: it is the primary key of every \ + row" + else S.succeed name) + identifier) and* label = S.field "label" textI18n and* type' = S.field "type" (field_type env) and* required = S.field_opt_or ~default:false "required" S.bool -- cgit v1.2.3