aboutsummaryrefslogtreecommitdiffstats
path: root/lib/protocols/Relation.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-07 23:26:50 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-07 23:26:50 -0300
commit483089803a411920fea7696ea6b40c664cf3003a (patch)
tree7ac682a41db96203fc1bd7d5e1ed6daa76c93c4e /lib/protocols/Relation.ml
parent4c0c69dc571577e9c3ae68830c042cfaada603ae (diff)
downloadRNT-483089803a411920fea7696ea6b40c664cf3003a.tar.gz
RNT-483089803a411920fea7696ea6b40c664cf3003a.zip
ephemeral literal, relation heading, subs rel stored & lmdb 1GB map
Diffstat (limited to 'lib/protocols/Relation.ml')
-rw-r--r--lib/protocols/Relation.ml14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/protocols/Relation.ml b/lib/protocols/Relation.ml
index b4cc4ec..9a6e739 100644
--- a/lib/protocols/Relation.ml
+++ b/lib/protocols/Relation.ml
@@ -18,15 +18,17 @@ let from handle = Handle.into handle (function Relation impl -> Some impl | _ ->
let require handle = from handle |> Option.to_result ~none:(Error.not_a_relation ())
let contains i tuple = Handle.invoke i (fun o -> o#contains tuple)
-let read relation =
+let heading relation =
let open Utilities.Result in
let* schematics = Handle.require Schematics.from relation in
let* description = Schematics.describe schematics in
- let* heading =
- match description with
- | Schematics.Relation heading -> Ok heading
- | _ -> Error (Error.not_a_relation ())
- in
+ match description with
+ | Schematics.Relation heading -> Ok heading
+ | _ -> Error (Error.not_a_relation ())
+
+let read relation =
+ let open Utilities.Result in
+ let* heading = heading relation in
let* enumerable = Enumerable.require relation in
let* cursor = Enumerable.enumerate enumerable in
Fun.protect