lora-ruby 0.5.6-x86_64-linux → 0.6.0-x86_64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 155820b5ff90f8828c11df7dd6ce3950b0601e2e374ea8353af9222db282c6f3
4
- data.tar.gz: d856048cb887c4cbefac9bbe7f4e72af2fb22eae82c6488d5140edd22fe952b9
3
+ metadata.gz: d16b151caa8498f6f7f535201b024ae763a77409fe6e00cdfefb73ecdc4134bf
4
+ data.tar.gz: b77d4d4c60e6f6e4d81ea49d6f66bc11e8373f4efd918599bc99cabb1c733425
5
5
  SHA512:
6
- metadata.gz: 06b481a3cdc376c01bdb2e8933974d6c736a48963a81ed78107f1547efadc3634983471fe4e8da8d07089f42715c92a8c0d2a4f854be78ede0c01b605e74d149
7
- data.tar.gz: 1a55006ecb781a0ac2ecdd37a75c89eb9d7571a31f7836d5d78b94bedb7e4fa9ce8406df609b77f00f9e61a2cae289c13b4515b0f59bfe49b01a8a5ad33fd669
6
+ metadata.gz: 0b72af87acb141f9c816ceb921dde8d44857699e41241ea966d8b1d67e08e9d5bf681321d0fa40058f42e4a23e70328f55655285e5d8e32fcb1f2e9791b88f23
7
+ data.tar.gz: a5111d6e8cc41ad52ee2a06bd8f12512ce4ba9eb49a7de600980cc159608da8adca3c8c72c3a9d018c197e5d56d4bb47dbb23b82e7aa9ffb6281d17c629e397f
data/README.md CHANGED
@@ -76,8 +76,9 @@ binding's `lora_python.Database` and because it mirrors the
76
76
  ## Public API
77
77
 
78
78
  ```ruby
79
- LoraRuby::Database.create(wal_dir = nil) # -> Database
80
- LoraRuby::Database.new(wal_dir = nil) # -> Database (alias of .create)
79
+ LoraRuby::Database.create(database_name = nil, options = nil) # -> Database
80
+ LoraRuby::Database.new(database_name = nil, options = nil) # -> Database
81
+ LoraRuby::Database.open_wal(wal_dir, options = nil) # -> Database
81
82
 
82
83
  db.execute(query, params = nil) # -> { "columns" => [...], "rows" => [...] }
83
84
  db.clear # -> nil
@@ -156,9 +157,19 @@ replays committed writes before returning the handle.
156
157
  Call `db.close` before reopening the same archive inside one
157
158
  process.
158
159
 
159
- This first Ruby persistence slice intentionally stays small: the
160
- binding exposes archive-backed initialization plus the existing snapshot
161
- APIs, but not checkpoint, truncate, status, or sync-mode controls.
160
+ For explicit WAL directories with managed snapshots, use `open_wal`:
161
+
162
+ ```ruby
163
+ db = LoraRuby::Database.open_wal(
164
+ "./data/wal",
165
+ snapshot_dir: "./data/snapshots",
166
+ snapshot_every_commits: 1000,
167
+ snapshot_keep_old: 2,
168
+ )
169
+ ```
170
+
171
+ `snapshot_options` accepts the same compression/encryption options as
172
+ `save_snapshot`.
162
173
 
163
174
  ## Concurrency (GVL release)
164
175
 
Binary file
Binary file
Binary file
@@ -7,7 +7,7 @@ module LoraRuby
7
7
  # - Scalars pass through as Ruby natives (`nil`, `true`, `false`,
8
8
  # `Integer`, `Float`, `String`).
9
9
  # - Lists and maps come back as `Array` / `Hash` (string keys).
10
- # - Graph, temporal, and spatial values come back as plain `Hash`es
10
+ # - Graph, temporal, spatial, vector, and binary values come back as plain `Hash`es
11
11
  # with a `"kind"` discriminator.
12
12
  #
13
13
  # If you want to narrow a value explicitly, use the `node?` / `point?`
@@ -56,6 +56,21 @@ module LoraRuby
56
56
  }
57
57
  end
58
58
 
59
+ # ------------------------------------------------------------------
60
+ # Binary / blob constructor — segmented bytes. The native extension
61
+ # accepts each segment as a Ruby String and preserves segment
62
+ # boundaries in WAL/snapshot storage.
63
+ # ------------------------------------------------------------------
64
+
65
+ def binary(segments)
66
+ copied = segments.map { |segment| segment.b.dup }
67
+ {
68
+ "kind" => "binary",
69
+ "length" => copied.sum(&:bytesize),
70
+ "segments" => copied,
71
+ }
72
+ end
73
+
59
74
  # ------------------------------------------------------------------
60
75
  # Spatial constructors — mirrors lora_python.cartesian / wgs84.
61
76
  # `cartesian(1, 2)` returns a 2D cartesian point; use `cartesian_3d`
@@ -122,6 +137,7 @@ module LoraRuby
122
137
  def path?(v) = tagged?(v, "path")
123
138
  def point?(v) = tagged?(v, "point")
124
139
  def vector?(v) = tagged?(v, "vector")
140
+ def binary?(v) = tagged?(v, "binary")
125
141
 
126
142
  def temporal?(v)
127
143
  return false unless v.is_a?(Hash)
@@ -10,5 +10,5 @@ module LoraRuby
10
10
  # Guard against redefinition so re-requiring this file (or loading
11
11
  # both paths) doesn't emit a "warning: already initialized constant"
12
12
  # when the native extension loads second with the identical value.
13
- VERSION = "0.5.6" unless const_defined?(:VERSION)
13
+ VERSION = "0.6.0" unless const_defined?(:VERSION)
14
14
  end
data/lib/lora_ruby.rb CHANGED
@@ -32,8 +32,8 @@ module LoraRuby
32
32
  %i[
33
33
  date time localtime datetime localdatetime duration
34
34
  cartesian cartesian_3d wgs84 wgs84_3d
35
- vector
36
- node? relationship? path? point? temporal? vector?
35
+ vector binary
36
+ node? relationship? path? point? temporal? vector? binary?
37
37
  ].each do |m|
38
38
  define_singleton_method(m) do |*args, **kwargs|
39
39
  if kwargs.empty?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lora-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - LoraDB, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-27 00:00:00.000000000 Z
11
+ date: 2026-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake