From bc78bea63b7c75e8a9d222dc86fb75ed293a2242 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sat, 21 Nov 2026 12:22:50 +0100 Subject: Renamed the module Typ into Types --- lib/query/create.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/query/create.ml') diff --git a/lib/query/create.ml b/lib/query/create.ml index 49047a7..cf364cf 100644 --- a/lib/query/create.ml +++ b/lib/query/create.ml @@ -39,8 +39,7 @@ ADD FOREIGN KEY (best_a_id) REFERENCES answer(a_id); *) -let get_foreign_statement : - Model.Identifier.t -> Model.Identifier.t -> string = +let get_foreign_statement : Model.Identifier.t -> Model.Identifier.t -> string = fun property dst_table -> "FOREIGN KEY(" ^ Model.Identifier.quote property @@ -69,7 +68,7 @@ let create_external_reference_table : (* The target is the id of a row in the target content table, or in the dedicated table of the target list *) let target_table = - match reference.Model.Typ.t with + match reference.Model.Types.t with | Model.Reference.Content ref -> Model.Content.id (Model.Reference.get ref) | Model.Reference.List list -> list.Model.DataList.id @@ -129,7 +128,7 @@ let create_list_table : match Model.Field.type_ field with | T (MonoReference reference) -> ( let column = Model.Field.name field in - match reference.Model.Typ.t with + match reference.Model.Types.t with | Model.Reference.List target -> let dst = target.Model.DataList.id in if List.mem ~set:created dst then @@ -149,7 +148,7 @@ let create_list_table : let fields = "\"id\" INTEGER PRIMARY KEY" :: List.fold_left list_fields ~init:foreign ~f:(fun acc field -> - match get_field_query field with None -> acc | Some q -> q :: acc) + match get_field_query field with None -> acc | Some q -> q :: acc) in let buff = Buffer.create 128 in let format = Format.formatter_of_buffer buff in @@ -217,7 +216,7 @@ let rec create_table : match Model.Field.type_ field with | T (MonoReference reference) -> ( let column = Model.Field.name field in - match reference.Model.Typ.t with + match reference.Model.Types.t with | Model.Reference.List list -> (* The list tables are created before the content tables, so the constraint can be declared directly *) @@ -335,7 +334,8 @@ let create : Caqti_lwt.connection -> Configuration.Ast.setting -> unit Lwt.t = let* foreign, _ = Lwt_list.fold_left_s (fun acc list -> create_list_table db acc list) - ([], []) (Configuration.Ast.lists conf) + ([], []) + (Configuration.Ast.lists conf) in let contents = Configuration.Ast.root_contents conf in let* foreign, _ = -- cgit v1.2.3