summaryrefslogtreecommitdiff
path: root/lib/query/insert.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/query/insert.ml')
-rw-r--r--lib/query/insert.ml24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/query/insert.ml b/lib/query/insert.ml
index 6e95631..ab0dc2b 100644
--- a/lib/query/insert.ml
+++ b/lib/query/insert.ml
@@ -3,9 +3,9 @@
(** Transform the list of fields from the model into a tuple with the type of
each field associated with *)
let collect_fields :
- ?init_fields:Model.Reference.t Model.Field.t list ->
- ?filter:('a Model.Field.t -> bool) ->
- 'a Model.Content.t ->
+ ?init_fields:Model.field list ->
+ ?filter:(Model.field -> bool) ->
+ Model.content ->
Intf.t =
fun ?(init_fields = []) ?filter content ->
let field_seq =
@@ -25,8 +25,8 @@ module MultiReferencesInsert = struct
type 'a t = {
db : Caqti_lwt.connection;
parent_id : int64;
- content : Model.Reference.t Model.Content.t;
- provider : string -> Model.Reference.t Model.Typ.value;
+ content : Model.content;
+ provider : string -> Model.value;
k : (unit, Caqti.Error.t) result Lwt.t;
}
@@ -105,8 +105,8 @@ module Fold = Encoder.Fold (MultiReferencesInsert)
*)
let insert_returning :
Caqti_lwt.connection ->
- Model.Reference.t Model.Content.t ->
- (string -> Model.Reference.t Model.Typ.value) ->
+ Model.content ->
+ (string -> Model.value) ->
int64 Lwt.t =
fun db content provider ->
let module Db = (val db) in
@@ -174,9 +174,9 @@ let insert_returning :
(** Insert an entry for a specific content *)
let insert :
Caqti_lwt.connection ->
- Model.Reference.t Model.Content.t ->
+ Model.content ->
?parent:int64 ->
- (string -> Model.Reference.t Model.Typ.value) ->
+ (string -> Model.value) ->
int64 Lwt.t =
fun db content ?parent provider ->
let provider =
@@ -200,14 +200,14 @@ let insert :
let insert_references :
Caqti_lwt.connection ->
- Model.Reference.t Model.Content.t ->
+ Model.content ->
Int64.t ->
Model.Identifier.t ->
- Model.Reference.t Model.Typ.value ->
+ Model.value ->
Int64.t Intf.data ->
unit Lwt.t =
fun db content content_id field_name value data ->
- let provider : string -> Model.Reference.t Model.Typ.value = function
+ let provider : string -> Model.value = function
| n when String.equal n (Model.Identifier.to_string field_name) -> value
| _ -> Model.Typ.None
in