summaryrefslogtreecommitdiff
path: root/lib/query/query.mli
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-03-27 08:48:05 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-03-27 08:48:05 +0100
commit830e7c5d27d161b91402414e6ecd49f1ed818bfb (patch)
tree448864635d29b1ea66424cbb9e0816fbcf1e1907 /lib/query/query.mli
Initial commit
Diffstat (limited to 'lib/query/query.mli')
-rw-r--r--lib/query/query.mli21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/query/query.mli b/lib/query/query.mli
new file mode 100644
index 0000000..1a26383
--- /dev/null
+++ b/lib/query/query.mli
@@ -0,0 +1,21 @@
+val insert :
+ Caqti_lwt.connection ->
+ Model.Reference.t Model.Content.t ->
+ ?parent:int64 ->
+ (string -> Model.Reference.t Model.Typ.value) ->
+ int64 Lwt.t
+(** Insert a new element and return the ID.
+
+ [insert content ~parent provider] will create the content in the database.
+
+ The parent is required if the content is a subcontent. Not providing the
+ parameter is a structural error in the database.
+
+ For each field in the content, the function [provider] will be called with
+ the name for this property. The value returned shall match the expected type
+ for this property, the execption [TypeMismatch] is raised otherwise.
+
+ This is a low-level function: there is no representation for the content
+ itself, and no functionnals controls are realized. *)
+
+val create : Caqti_lwt.connection -> Configuration.Ast.setting -> unit Lwt.t