aboutsummaryrefslogtreecommitdiffstats
path: root/src/operations.erl
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-03-04 00:48:10 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-03-04 00:48:10 -0300
commita02a0cc86ccc2ca3e05a57debc34ac47379cf3ea (patch)
tree9893c76020b677b5de609b7738d44f4a8d81ea8e /src/operations.erl
parent24e5e531134fbb8757151a68438d0b8426c91c4c (diff)
downloadSakura-a02a0cc86ccc2ca3e05a57debc34ac47379cf3ea.tar.gz
Sakura-a02a0cc86ccc2ca3e05a57debc34ac47379cf3ea.zip
generalize constraints in membership with quantification
Diffstat (limited to '')
-rw-r--r--src/operations.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/operations.erl b/src/operations.erl
index 8773e0e..de61fd8 100644
--- a/src/operations.erl
+++ b/src/operations.erl
@@ -41,6 +41,7 @@
-include("../include/operations.hrl").
-export([
create_database/1,
+ value_hash/1,
create_relation/3,
create_immutable_relation/2,
update_relation_constraints/3,
@@ -87,6 +88,17 @@
hash(Value) ->
crypto:hash(sha256, term_to_binary(Value)).
+%% @doc Hash a value using Sakura's canonical content hash.
+%%
+%% Public wrapper around the internal hash function, used by other modules
+%% that need to compare values against stored attribute hashes.
+%%
+%% @param Value Any Erlang term
+%% @returns Binary SHA-256 hash
+-spec value_hash(term()) -> binary().
+value_hash(Value) ->
+ hash(Value).
+
%% @doc Insert a tuple into a relation and update the database state.
%%
%% This is the primary operation for adding data to the database. It: