lora-python 0.5.0__tar.gz → 0.5.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lora_python-0.5.0 → lora_python-0.5.4}/Cargo.lock +14 -14
- {lora_python-0.5.0 → lora_python-0.5.4}/Cargo.toml +9 -9
- {lora_python-0.5.0 → lora_python-0.5.4}/PKG-INFO +11 -11
- {lora_python-0.5.0 → lora_python-0.5.4}/README.md +10 -10
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/wal_benchmarks.rs +1 -1
- lora_python-0.5.4/crates/lora-database/src/archive.rs +720 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/src/database.rs +3 -3
- lora_python-0.5.4/crates/lora-database/src/named.rs +204 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/wal.rs +208 -8
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/README.md +10 -10
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/examples/basic.py +1 -1
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/dir.rs +10 -12
- lora_python-0.5.4/crates/lora-wal/src/lock.rs +220 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/recorder_adapter.rs +1 -1
- {lora_python-0.5.0 → lora_python-0.5.4}/pyproject.toml +1 -1
- {lora_python-0.5.0 → lora_python-0.5.4}/python/lora_python/__init__.py +1 -1
- {lora_python-0.5.0 → lora_python-0.5.4}/python/lora_python/_async.py +1 -1
- lora_python-0.5.0/crates/lora-database/src/archive.rs +0 -314
- lora_python-0.5.0/crates/lora-database/src/named.rs +0 -124
- lora_python-0.5.0/crates/lora-wal/src/lock.rs +0 -104
- {lora_python-0.5.0 → lora_python-0.5.4}/LICENSE +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/src/analyzer.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/src/errors.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/src/resolved.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/src/scope.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-analyzer/src/symbols.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-ast/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-ast/src/ast.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-ast/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/src/logical.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/src/optimizer.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/src/pattern.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/src/physical.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-compiler/src/planner.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/advanced_benchmarks.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/engine_benchmarks.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/fixtures.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/perf_smoke_baseline.json +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/perf_smoke_benchmarks.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/scale_benchmarks.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/benches/temporal_spatial_benchmarks.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/src/stream.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/src/transaction.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/advanced_queries.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/aggregation.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/backend_stub.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/create.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/errors.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/expressions.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/functions_extended.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/invariants.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/match.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/merge.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/ordering.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/parameters.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/parser.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/paths.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/projection.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/seeds.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/snapshot.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/spatial.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/temporal.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/test_helpers.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/transactions.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/types_advanced.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/union.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/update.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/vectors.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/where_clause.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-database/tests/with.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/src/errors.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/src/eval.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/src/executor.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/src/pull.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-executor/src/value.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-parser/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-parser/src/cypher.pest +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-parser/src/error.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-parser/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-parser/src/parser.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/.gitignore +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/LICENSE +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/build.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/examples/async_demo.py +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/tests/test_async.py +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-python/tests/test_sync.py +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/graph.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/memory.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/mutation.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/snapshot.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/spatial.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/temporal.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-store/src/vector.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/Cargo.toml +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/config.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/error.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/lib.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/lsn.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/record.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/replay.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/segment.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/testing.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/crates/lora-wal/src/wal.rs +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/python/lora_python/_native.pyi +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/python/lora_python/py.typed +0 -0
- {lora_python-0.5.0 → lora_python-0.5.4}/python/lora_python/types.py +0 -0
|
@@ -651,7 +651,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
|
|
|
651
651
|
|
|
652
652
|
[[package]]
|
|
653
653
|
name = "lora-analyzer"
|
|
654
|
-
version = "0.5.
|
|
654
|
+
version = "0.5.4"
|
|
655
655
|
dependencies = [
|
|
656
656
|
"lora-ast",
|
|
657
657
|
"lora-parser",
|
|
@@ -661,14 +661,14 @@ dependencies = [
|
|
|
661
661
|
|
|
662
662
|
[[package]]
|
|
663
663
|
name = "lora-ast"
|
|
664
|
-
version = "0.5.
|
|
664
|
+
version = "0.5.4"
|
|
665
665
|
dependencies = [
|
|
666
666
|
"smallvec 2.0.0-alpha.12",
|
|
667
667
|
]
|
|
668
668
|
|
|
669
669
|
[[package]]
|
|
670
670
|
name = "lora-compiler"
|
|
671
|
-
version = "0.5.
|
|
671
|
+
version = "0.5.4"
|
|
672
672
|
dependencies = [
|
|
673
673
|
"lora-analyzer",
|
|
674
674
|
"lora-ast",
|
|
@@ -676,7 +676,7 @@ dependencies = [
|
|
|
676
676
|
|
|
677
677
|
[[package]]
|
|
678
678
|
name = "lora-database"
|
|
679
|
-
version = "0.5.
|
|
679
|
+
version = "0.5.4"
|
|
680
680
|
dependencies = [
|
|
681
681
|
"anyhow",
|
|
682
682
|
"criterion",
|
|
@@ -694,7 +694,7 @@ dependencies = [
|
|
|
694
694
|
|
|
695
695
|
[[package]]
|
|
696
696
|
name = "lora-executor"
|
|
697
|
-
version = "0.5.
|
|
697
|
+
version = "0.5.4"
|
|
698
698
|
dependencies = [
|
|
699
699
|
"lora-analyzer",
|
|
700
700
|
"lora-ast",
|
|
@@ -708,7 +708,7 @@ dependencies = [
|
|
|
708
708
|
|
|
709
709
|
[[package]]
|
|
710
710
|
name = "lora-ffi"
|
|
711
|
-
version = "0.5.
|
|
711
|
+
version = "0.5.4"
|
|
712
712
|
dependencies = [
|
|
713
713
|
"lora-database",
|
|
714
714
|
"lora-store",
|
|
@@ -718,7 +718,7 @@ dependencies = [
|
|
|
718
718
|
|
|
719
719
|
[[package]]
|
|
720
720
|
name = "lora-node"
|
|
721
|
-
version = "0.5.
|
|
721
|
+
version = "0.5.4"
|
|
722
722
|
dependencies = [
|
|
723
723
|
"anyhow",
|
|
724
724
|
"lora-database",
|
|
@@ -732,7 +732,7 @@ dependencies = [
|
|
|
732
732
|
|
|
733
733
|
[[package]]
|
|
734
734
|
name = "lora-parser"
|
|
735
|
-
version = "0.5.
|
|
735
|
+
version = "0.5.4"
|
|
736
736
|
dependencies = [
|
|
737
737
|
"lora-ast",
|
|
738
738
|
"pest",
|
|
@@ -743,7 +743,7 @@ dependencies = [
|
|
|
743
743
|
|
|
744
744
|
[[package]]
|
|
745
745
|
name = "lora-python"
|
|
746
|
-
version = "0.5.
|
|
746
|
+
version = "0.5.4"
|
|
747
747
|
dependencies = [
|
|
748
748
|
"anyhow",
|
|
749
749
|
"lora-database",
|
|
@@ -755,7 +755,7 @@ dependencies = [
|
|
|
755
755
|
|
|
756
756
|
[[package]]
|
|
757
757
|
name = "lora-server"
|
|
758
|
-
version = "0.5.
|
|
758
|
+
version = "0.5.4"
|
|
759
759
|
dependencies = [
|
|
760
760
|
"anyhow",
|
|
761
761
|
"axum",
|
|
@@ -769,7 +769,7 @@ dependencies = [
|
|
|
769
769
|
|
|
770
770
|
[[package]]
|
|
771
771
|
name = "lora-store"
|
|
772
|
-
version = "0.5.
|
|
772
|
+
version = "0.5.4"
|
|
773
773
|
dependencies = [
|
|
774
774
|
"bincode",
|
|
775
775
|
"crc32fast",
|
|
@@ -781,7 +781,7 @@ dependencies = [
|
|
|
781
781
|
|
|
782
782
|
[[package]]
|
|
783
783
|
name = "lora-wal"
|
|
784
|
-
version = "0.5.
|
|
784
|
+
version = "0.5.4"
|
|
785
785
|
dependencies = [
|
|
786
786
|
"bincode",
|
|
787
787
|
"crc32fast",
|
|
@@ -792,7 +792,7 @@ dependencies = [
|
|
|
792
792
|
|
|
793
793
|
[[package]]
|
|
794
794
|
name = "lora-wasm"
|
|
795
|
-
version = "0.5.
|
|
795
|
+
version = "0.5.4"
|
|
796
796
|
dependencies = [
|
|
797
797
|
"anyhow",
|
|
798
798
|
"console_error_panic_hook",
|
|
@@ -807,7 +807,7 @@ dependencies = [
|
|
|
807
807
|
|
|
808
808
|
[[package]]
|
|
809
809
|
name = "lora_ruby"
|
|
810
|
-
version = "0.5.
|
|
810
|
+
version = "0.5.4"
|
|
811
811
|
dependencies = [
|
|
812
812
|
"anyhow",
|
|
813
813
|
"lora-database",
|
|
@@ -4,7 +4,7 @@ resolver = "2"
|
|
|
4
4
|
|
|
5
5
|
[workspace.package]
|
|
6
6
|
edition = "2021"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.4"
|
|
8
8
|
license = "BUSL-1.1"
|
|
9
9
|
authors = ["LoraDB, Inc."]
|
|
10
10
|
repository = "https://github.com/lora-db/lora"
|
|
@@ -15,14 +15,14 @@ rust-version = "1.87"
|
|
|
15
15
|
# Internal crates — versions are kept in lockstep with [workspace.package].version
|
|
16
16
|
# by `scripts/sync-versions.mjs`. Both `path` and `version` are set so that
|
|
17
17
|
# `cargo publish` works (crates.io cannot resolve path-only deps).
|
|
18
|
-
lora-ast = { path = "crates/lora-ast", version = "=0.5.
|
|
19
|
-
lora-parser = { path = "crates/lora-parser", version = "=0.5.
|
|
20
|
-
lora-analyzer = { path = "crates/lora-analyzer", version = "=0.5.
|
|
21
|
-
lora-compiler = { path = "crates/lora-compiler", version = "=0.5.
|
|
22
|
-
lora-store = { path = "crates/lora-store", version = "=0.5.
|
|
23
|
-
lora-wal = { path = "crates/lora-wal", version = "=0.5.
|
|
24
|
-
lora-executor = { path = "crates/lora-executor", version = "=0.5.
|
|
25
|
-
lora-database = { path = "crates/lora-database", version = "=0.5.
|
|
18
|
+
lora-ast = { path = "crates/lora-ast", version = "=0.5.4" }
|
|
19
|
+
lora-parser = { path = "crates/lora-parser", version = "=0.5.4" }
|
|
20
|
+
lora-analyzer = { path = "crates/lora-analyzer", version = "=0.5.4" }
|
|
21
|
+
lora-compiler = { path = "crates/lora-compiler", version = "=0.5.4" }
|
|
22
|
+
lora-store = { path = "crates/lora-store", version = "=0.5.4" }
|
|
23
|
+
lora-wal = { path = "crates/lora-wal", version = "=0.5.4" }
|
|
24
|
+
lora-executor = { path = "crates/lora-executor", version = "=0.5.4" }
|
|
25
|
+
lora-database = { path = "crates/lora-database", version = "=0.5.4" }
|
|
26
26
|
|
|
27
27
|
# External crates.
|
|
28
28
|
anyhow = "1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lora-python
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.8
|
|
@@ -70,11 +70,11 @@ Initialization rule:
|
|
|
70
70
|
from lora_python import Database
|
|
71
71
|
|
|
72
72
|
scratch = Database.create() # in-memory
|
|
73
|
-
persistent = Database.create("
|
|
73
|
+
persistent = Database.create("app", {"database_dir": "./data"}) # persistent: ./data/app.loradb
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
If you want persistence, pass a
|
|
77
|
-
or `Database(...)`.
|
|
76
|
+
If you want persistence, pass a database name and `database_dir` to
|
|
77
|
+
`Database.create(...)` or `Database(...)`.
|
|
78
78
|
|
|
79
79
|
## Async usage (non-blocking)
|
|
80
80
|
|
|
@@ -95,7 +95,7 @@ Async initialization follows the same rule:
|
|
|
95
95
|
|
|
96
96
|
```python
|
|
97
97
|
db = await AsyncDatabase.create() # in-memory
|
|
98
|
-
db = await AsyncDatabase.create("
|
|
98
|
+
db = await AsyncDatabase.create("app", {"database_dir": "./data"}) # persistent: ./data/app.loradb
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
`AsyncDatabase.execute` dispatches the query onto the default asyncio
|
|
@@ -146,16 +146,16 @@ All three are available as `lora_python.LoraError`, etc.
|
|
|
146
146
|
|
|
147
147
|
## Persistence
|
|
148
148
|
|
|
149
|
-
`Database.create("
|
|
150
|
-
`await AsyncDatabase.create("
|
|
151
|
-
persistent database
|
|
149
|
+
`Database.create("app", {"database_dir": "./data"})`, `Database("app", {"database_dir": "./data"})`, and
|
|
150
|
+
`await AsyncDatabase.create("app", {"database_dir": "./data"})` open or create
|
|
151
|
+
an archive-backed persistent database at `./data/app.loradb`. Reopening the same path
|
|
152
152
|
replays committed writes before returning the handle.
|
|
153
153
|
|
|
154
|
-
Call `db.close()` / `await db.close()` before reopening the same
|
|
155
|
-
|
|
154
|
+
Call `db.close()` / `await db.close()` before reopening the same archive
|
|
155
|
+
inside one process.
|
|
156
156
|
|
|
157
157
|
This first Python persistence slice intentionally stays small: the
|
|
158
|
-
binding exposes
|
|
158
|
+
binding exposes archive-backed initialization plus the existing
|
|
159
159
|
`save_snapshot` / `load_snapshot` APIs, but not checkpoint, truncate,
|
|
160
160
|
status, or sync-mode controls.
|
|
161
161
|
|
|
@@ -40,11 +40,11 @@ Initialization rule:
|
|
|
40
40
|
from lora_python import Database
|
|
41
41
|
|
|
42
42
|
scratch = Database.create() # in-memory
|
|
43
|
-
persistent = Database.create("
|
|
43
|
+
persistent = Database.create("app", {"database_dir": "./data"}) # persistent: ./data/app.loradb
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
If you want persistence, pass a
|
|
47
|
-
or `Database(...)`.
|
|
46
|
+
If you want persistence, pass a database name and `database_dir` to
|
|
47
|
+
`Database.create(...)` or `Database(...)`.
|
|
48
48
|
|
|
49
49
|
## Async usage (non-blocking)
|
|
50
50
|
|
|
@@ -65,7 +65,7 @@ Async initialization follows the same rule:
|
|
|
65
65
|
|
|
66
66
|
```python
|
|
67
67
|
db = await AsyncDatabase.create() # in-memory
|
|
68
|
-
db = await AsyncDatabase.create("
|
|
68
|
+
db = await AsyncDatabase.create("app", {"database_dir": "./data"}) # persistent: ./data/app.loradb
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
`AsyncDatabase.execute` dispatches the query onto the default asyncio
|
|
@@ -116,16 +116,16 @@ All three are available as `lora_python.LoraError`, etc.
|
|
|
116
116
|
|
|
117
117
|
## Persistence
|
|
118
118
|
|
|
119
|
-
`Database.create("
|
|
120
|
-
`await AsyncDatabase.create("
|
|
121
|
-
persistent database
|
|
119
|
+
`Database.create("app", {"database_dir": "./data"})`, `Database("app", {"database_dir": "./data"})`, and
|
|
120
|
+
`await AsyncDatabase.create("app", {"database_dir": "./data"})` open or create
|
|
121
|
+
an archive-backed persistent database at `./data/app.loradb`. Reopening the same path
|
|
122
122
|
replays committed writes before returning the handle.
|
|
123
123
|
|
|
124
|
-
Call `db.close()` / `await db.close()` before reopening the same
|
|
125
|
-
|
|
124
|
+
Call `db.close()` / `await db.close()` before reopening the same archive
|
|
125
|
+
inside one process.
|
|
126
126
|
|
|
127
127
|
This first Python persistence slice intentionally stays small: the
|
|
128
|
-
binding exposes
|
|
128
|
+
binding exposes archive-backed initialization plus the existing
|
|
129
129
|
`save_snapshot` / `load_snapshot` APIs, but not checkpoint, truncate,
|
|
130
130
|
status, or sync-mode controls.
|
|
131
131
|
|
|
@@ -204,7 +204,7 @@ fn bench_named_archive_write_heavy(c: &mut Criterion) {
|
|
|
204
204
|
|
|
205
205
|
// One timed iteration performs a realistic write burst. For the
|
|
206
206
|
// persistent variant, dropping the DB at the end joins the archive writer
|
|
207
|
-
// and includes the final `.
|
|
207
|
+
// and includes the final `.loradb` ZIP flush, so the result measures more
|
|
208
208
|
// than just "enqueue dirty flag".
|
|
209
209
|
const WRITES: usize = 1_000;
|
|
210
210
|
|