diff --git a/Cargo.lock b/Cargo.lock
index 7b88ca3..83e6b37 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,6 +2,18 @@
# It is not intended for manual editing.
version = 4
+[[package]]
+name = "ahash"
+version = "0.8.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
+dependencies = [
+ "cfg-if",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
[[package]]
name = "aho-corasick"
version = "1.1.4"
@@ -47,12 +59,6 @@ dependencies = [
"serde",
]
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
[[package]]
name = "bitflags"
version = "2.11.1"
@@ -149,15 +155,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "crc32fast"
-version = "1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
-dependencies = [
- "cfg-if",
-]
-
[[package]]
name = "critical-section"
version = "1.2.0"
@@ -209,7 +206,7 @@ dependencies = [
"hashbrown 0.14.5",
"lock_api",
"once_cell",
- "parking_lot_core 0.9.12",
+ "parking_lot_core",
]
[[package]]
@@ -290,6 +287,18 @@ version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59"
+[[package]]
+name = "fallible-iterator"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
+
+[[package]]
+name = "fallible-streaming-iterator"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
+
[[package]]
name = "fastrand"
version = "2.4.1"
@@ -334,25 +343,6 @@ dependencies = [
"percent-encoding",
]
-[[package]]
-name = "fs2"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
-name = "fxhash"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
-dependencies = [
- "byteorder",
-]
-
[[package]]
name = "geolog-lang"
version = "0.1.0"
@@ -385,6 +375,7 @@ version = "0.1.0"
dependencies = [
"geomerge",
"serde_json",
+ "storage",
]
[[package]]
@@ -420,6 +411,9 @@ name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
+dependencies = [
+ "ahash",
+]
[[package]]
name = "hashbrown"
@@ -442,6 +436,15 @@ version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
+[[package]]
+name = "hashlink"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af"
+dependencies = [
+ "hashbrown 0.14.5",
+]
+
[[package]]
name = "heapless"
version = "0.7.17"
@@ -468,7 +471,7 @@ version = "0.20.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d4f449bab7320c56003d37732a917e18798e2f1709d80263face2b4f9436ddb"
dependencies = [
- "bitflags 2.11.1",
+ "bitflags",
"byteorder",
"heed-traits",
"heed-types",
@@ -645,15 +648,6 @@ dependencies = [
"serde_core",
]
-[[package]]
-name = "instant"
-version = "0.1.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
-dependencies = [
- "cfg-if",
-]
-
[[package]]
name = "interval-heap"
version = "0.0.5"
@@ -693,6 +687,17 @@ version = "0.2.186"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
+[[package]]
+name = "libsqlite3-sys"
+version = "0.30.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
+dependencies = [
+ "cc",
+ "pkg-config",
+ "vcpkg",
+]
+
[[package]]
name = "linux-raw-sys"
version = "0.12.1"
@@ -791,7 +796,7 @@ version = "0.31.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
dependencies = [
- "bitflags 2.11.1",
+ "bitflags",
"cfg-if",
"cfg_aliases",
"libc",
@@ -822,31 +827,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "parking_lot"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core 0.8.6",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall 0.2.16",
- "smallvec",
- "winapi",
-]
-
[[package]]
name = "parking_lot_core"
version = "0.9.12"
@@ -855,7 +835,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall 0.5.18",
+ "redox_syscall",
"smallvec",
"windows-link",
]
@@ -932,6 +912,12 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
+[[package]]
+name = "pkg-config"
+version = "0.3.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
+
[[package]]
name = "postcard"
version = "1.1.3"
@@ -977,19 +963,7 @@ dependencies = [
name = "query-ops"
version = "0.1.0"
dependencies = [
- "query-storage",
-]
-
-[[package]]
-name = "query-storage"
-version = "0.1.0"
-dependencies = [
- "fjall",
- "geomerge",
- "heed",
- "redb",
- "sled",
- "tempfile",
+ "storage",
]
[[package]]
@@ -1051,22 +1025,13 @@ dependencies = [
"libc",
]
-[[package]]
-name = "redox_syscall"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
-dependencies = [
- "bitflags 1.3.2",
-]
-
[[package]]
name = "redox_syscall"
version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
dependencies = [
- "bitflags 2.11.1",
+ "bitflags",
]
[[package]]
@@ -1086,6 +1051,20 @@ version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
+[[package]]
+name = "rusqlite"
+version = "0.32.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e"
+dependencies = [
+ "bitflags",
+ "fallible-iterator",
+ "fallible-streaming-iterator",
+ "hashlink",
+ "libsqlite3-sys",
+ "smallvec",
+]
+
[[package]]
name = "rustc-hash"
version = "2.1.2"
@@ -1107,7 +1086,7 @@ version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
- "bitflags 2.11.1",
+ "bitflags",
"errno",
"libc",
"linux-raw-sys",
@@ -1120,7 +1099,7 @@ version = "18.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a990b25f351b25139ddc7f21ee3f6f56f86d6846b74ac8fad3a719a287cd4a0"
dependencies = [
- "bitflags 2.11.1",
+ "bitflags",
"cfg-if",
"clipboard-win",
"home",
@@ -1223,22 +1202,6 @@ version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"
-[[package]]
-name = "sled"
-version = "0.34.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935"
-dependencies = [
- "crc32fast",
- "crossbeam-epoch",
- "crossbeam-utils",
- "fs2",
- "fxhash",
- "libc",
- "log",
- "parking_lot",
-]
-
[[package]]
name = "smallvec"
version = "1.15.1"
@@ -1266,6 +1229,19 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ae9eec00137a8eed469fb4148acd9fc6ac8c3f9b110f52cd34698c8b5bfa0e"
+[[package]]
+name = "storage"
+version = "0.1.0"
+dependencies = [
+ "fjall",
+ "geomerge",
+ "heed",
+ "redb",
+ "rusqlite",
+ "smallvec",
+ "tempfile",
+]
+
[[package]]
name = "syn"
version = "2.0.117"
@@ -1487,6 +1463,18 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23"
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
+name = "version_check"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
+
[[package]]
name = "wasip2"
version = "1.0.3+wasi-0.2.9"
@@ -1533,7 +1521,7 @@ version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
dependencies = [
- "bitflags 2.11.1",
+ "bitflags",
"hashbrown 0.15.5",
"indexmap",
"semver",
@@ -1640,7 +1628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
dependencies = [
"anyhow",
- "bitflags 2.11.1",
+ "bitflags",
"indexmap",
"log",
"serde",
@@ -1705,6 +1693,26 @@ dependencies = [
"synstructure",
]
+[[package]]
+name = "zerocopy"
+version = "0.8.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b065d4f0e55f82fae73202e189638116a87c55ab6b8e6c2721e13dd9d854ad1"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.8.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b631b19d36a892ab55420c92dbc83ccd79274f25be714855d3074aa71cab639"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
[[package]]
name = "zerofrom"
version = "0.1.8"
diff --git a/crates/geomerge-demo/Cargo.toml b/crates/geomerge-demo/Cargo.toml
index 2e9a343..db64078 100644
--- a/crates/geomerge-demo/Cargo.toml
+++ b/crates/geomerge-demo/Cargo.toml
@@ -10,4 +10,5 @@ workspace = true
[dependencies]
geomerge = { path = "../../external/geomerge/crates/geomerge" }
+storage = { path = "../storage", features = ["geomerge"] }
serde_json = "1"
diff --git a/crates/geomerge-demo/docs/diagrams/workflow.dot b/crates/geomerge-demo/docs/diagrams/workflow.dot
index ee724d2..0848f3d 100644
--- a/crates/geomerge-demo/docs/diagrams/workflow.dot
+++ b/crates/geomerge-demo/docs/diagrams/workflow.dot
@@ -58,21 +58,26 @@ flat_theory [label = <
-| add_paths_data (transact) |
-| • append Graphs rows |
-| • append G0, G1 rows |
-| • append G.V vertices |
-| • append G.E edge |
+| add_paths_data (tx.insert ×7) |
+| • insert Graphs rows |
+| • insert G0, G1 rows |
+| • insert G.V vertices |
+| • insert G.E edge |
+| • pending RowIds reused as FKs |
>, fillcolor = "#E8F5E9", color = "#4CAF50", shape = box]
-validate [label = "Law Validation\n(append_row_validated)", fillcolor = "#E8F5E9", color = "#4CAF50"]
-assert_edge [label = "assert_edge_was_stored\n(row count, cells)", fillcolor = "#E8F5E9", color = "#4CAF50"]
+commit [label = <
+| tx.commit() |
+| • law validation |
+| • CommittedTx resolves pending RowIds |
+
>, fillcolor = "#E8F5E9", color = "#4CAF50", shape = box]
+assert_edge [label = "assert_edge_was_stored\n(storage.scan(G.E))", fillcolor = "#E8F5E9", color = "#4CAF50"]
}
subgraph cluster_persist {
@@ -114,9 +119,8 @@ build_store -> transact [color = "#4CAF50"]
fixture_rows -> transact [style = "dashed", color = "#2196F3"]
// Transaction internals
-transact -> validate [color = "#4CAF50"]
-validate -> transact [style = "dashed", label = "row ids", color = "#4CAF50"]
-transact -> assert_edge [color = "#4CAF50"]
+transact -> commit [color = "#4CAF50"]
+commit -> assert_edge [color = "#4CAF50"]
// Into persistence
assert_edge -> dump_before [color = "#FF9800"]
diff --git a/crates/geomerge-demo/docs/diagrams/workflow.svg b/crates/geomerge-demo/docs/diagrams/workflow.svg
index 23f3e81..aded812 100644
--- a/crates/geomerge-demo/docs/diagrams/workflow.svg
+++ b/crates/geomerge-demo/docs/diagrams/workflow.svg
@@ -1,247 +1,385 @@
+ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-