aboutsummaryrefslogtreecommitdiffstats
path: root/include/operations.hrl
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2025-12-14 00:27:18 -0300
committerGitHub <noreply@github.com>2025-12-14 00:27:18 -0300
commitff5691ffb1a969e50e0bd5e4638be8e2bb342c4e (patch)
tree565346b82901f2ee26cb49b04e1e99ba1fb0e896 /include/operations.hrl
parent0862cd7c3fe4fbb5b56a0a87c3789c8361bc022c (diff)
downloadSakura-ff5691ffb1a969e50e0bd5e4638be8e2bb342c4e.tar.gz
Sakura-ff5691ffb1a969e50e0bd5e4638be8e2bb342c4e.zip
Ephemeral relations, Refactor & Cleanup (#34)
Diffstat (limited to '')
-rw-r--r--include/operations.hrl24
1 files changed, 3 insertions, 21 deletions
diff --git a/include/operations.hrl b/include/operations.hrl
index b027bb0..dcaa287 100644
--- a/include/operations.hrl
+++ b/include/operations.hrl
@@ -11,15 +11,15 @@
cardinality, % {finite, N} | aleph_zero | continuum
generator, % Generator function (immutable only), undefined for tree-based
membership_criteria, % #{attribute_name => constraint_spec()} - domain membership test
- mutability, % mutable | immutable
- provenance % Provenance tracking for updatable views (future)
+ provenance, % attribute_provenance() - maps attribute to source relation
+ lineage % lineage_op() - operation tree showing derivation
}).
-record(tuple, {hash, relation, attribute_map}).
-record(attribute, {hash, value}).
%% Specification record for creating immutable relations
--record(immutable_relation_spec, {
+-record(domain, {
name, % Atom - relation name
schema, % #{attribute_name => relation_name}
generator, % {module, function} - tuple generator
@@ -33,11 +33,6 @@
| aleph_zero % Countably infinite (ℵ₀)
| continuum. % Uncountably infinite (2^ℵ₀)
-%%% Mutability Types
-
--type mutability() :: mutable % Supports insert/delete (tree-based)
- | immutable. % Read-only (generator-based or protected)
-
%%% Constraint Types
-type constraint_spec() ::
@@ -108,16 +103,3 @@
| {take, pos_integer(), lineage_op()} % Limit operation
| {aggregate, atom(), atom(), lineage_op()}. % Aggregation (future)
-%% Tuple metadata (contains provenance, lineage, and other system-managed fields)
--type tuple_metadata() :: #{
- provenance => attribute_provenance(),
- lineage => lineage_op()
- % Future: timestamp, version, etc.
-}.
-
-%% Tuples with metadata use a nested 'meta' field:
-%% #{id => 1, name => "Alice",
-%% meta => #{
-%% provenance => #{id => {employees, id}, name => {employees, name}},
-%% lineage => {select, fun(T) -> maps:get(age, T) > 30 end, {base, employees}}
-%% }}