diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-11-20 16:23:53 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-11-20 16:23:53 +0100 |
| commit | b05e2d2be7be28ee6c577671002797cf9abaf177 (patch) | |
| tree | 0474684d619721024f0a6cb132cf2f4d2e84c344 /lib/configuration/read_conf.ml | |
| parent | c4ca180fd7c2085e3ce3f8e32aa0c2cb724f4c53 (diff) | |
New module for working with Values
Diffstat (limited to 'lib/configuration/read_conf.ml')
| -rw-r--r-- | lib/configuration/read_conf.ml | 11 |
1 files changed, 10 insertions, 1 deletions
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 |
