lora-ruby 0.6.0-aarch64-linux → 0.8.5-aarch64-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: 625e87d729f6f0fe8cd122e0a87a4d2908445f9d5e4880177e2113e980d7a790
4
- data.tar.gz: a3f3a29409f5d880a1f28a4e495a19414e2eb863bef9f59969485e4f249b6c16
3
+ metadata.gz: a128139ba04d8466e73a34ef354cc3a84099132ada4e557234c5f1920c4277ec
4
+ data.tar.gz: d3e675fb05ee688d489f141b255c1b03583bad37de896c18d0b39ca2cd43deef
5
5
  SHA512:
6
- metadata.gz: 9041a08d3fec37fd16976e1ff2baa5f11e46cae0f3a2548656538ef845641be5c6cfdc0a8c1f4f806ec3974e4085d881e71ebf2cc901719c92dfb60e6b947f76
7
- data.tar.gz: f2d582b1624f6293ecb8a72b175c80d1e9243b6f2f8866c313eb12675b5777e4e19596b98795ff51c0455147246598a56e10a27ba87f60b754e47b9e23990a88
6
+ metadata.gz: 20c93a57f4d488569210ed3c6d238af1dede85c90081dacb6bb76da3be8088455158e8a029a2063164ce6cae43464b352223845e8d3569472a4aa428ebc7241d
7
+ data.tar.gz: cf6b661c909a4302b2ececd6dce2ef392ed1fdc43662d9626e2e66a3eb01e0ba905c93b54a0029a76bb24834ade38d5b1cc802456a84c1143c31361b13680f80
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # lora-ruby
2
2
 
3
- Ruby bindings for the [Lora](../../README.md) graph engine.
3
+ Ruby bindings for the [Lora](../../../README.md) graph engine.
4
4
  Ships a native extension built with [Magnus](https://github.com/matsadler/magnus)
5
5
  on top of [`rb-sys`](https://github.com/oxidize-rb/rb-sys) so the Rust
6
6
  engine runs in-process — no separate server, no socket hop.
@@ -81,6 +81,8 @@ LoraRuby::Database.new(database_name = nil, options = nil) # -> Database
81
81
  LoraRuby::Database.open_wal(wal_dir, options = nil) # -> Database
82
82
 
83
83
  db.execute(query, params = nil) # -> { "columns" => [...], "rows" => [...] }
84
+ db.explain(query, params = nil) # -> plan Hash; never executes
85
+ db.profile(query, params = nil) # -> { "plan" => ..., "metrics" => ... }; PROFILE executes writes
84
86
  db.clear # -> nil
85
87
  db.node_count # -> Integer
86
88
  db.relationship_count # -> Integer
@@ -102,6 +104,37 @@ Hash keys on the output are always **strings**, matching the `lora-node`,
102
104
  symbol or string keys — both work for param names and for tagged
103
105
  constructor Hashes like `point`/`date`/...
104
106
 
107
+ ### Explain & Profile
108
+
109
+ `db.explain` and `db.profile` are first-class methods alongside
110
+ `db.execute`. They are intentionally *separate calls*, not a flag on
111
+ `execute`, so plan inspection and runtime metrics must be requested
112
+ explicitly.
113
+
114
+ ```ruby
115
+ plan = db.explain(
116
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
117
+ { "name" => "Alice" }
118
+ )
119
+ plan["shape"] # => "readOnly"
120
+ plan["tree"]["operator"]
121
+
122
+ profile = db.profile(
123
+ "MATCH (p:Person) WHERE p.name = $name RETURN p",
124
+ { "name" => "Alice" }
125
+ )
126
+ profile["metrics"]["total_elapsed_ns"]
127
+ profile["metrics"]["per_operator"] # per-step inclusive timing
128
+ ```
129
+
130
+ `explain` never invokes the executor — calling it on a mutating query
131
+ (`CREATE`, `MERGE`, `SET`, `DELETE`, `REMOVE`) leaves the graph
132
+ untouched.
133
+
134
+ > **`profile` executes the query for real.** Mutating queries are
135
+ > persisted exactly as in `execute`. Use `explain` to inspect a
136
+ > mutating plan without running it.
137
+
105
138
  ## Typed value model
106
139
 
107
140
  Identical contract to the other bindings:
@@ -174,9 +207,8 @@ db = LoraRuby::Database.open_wal(
174
207
  ## Concurrency (GVL release)
175
208
 
176
209
  `Database#execute` calls `rb_thread_call_without_gvl`, so other Ruby
177
- threads run while the engine is busy. Concurrent queries against the
178
- same `Database` serialise on an internal `Mutex`; parallel queries
179
- against **different** `Database` instances have no shared state.
210
+ threads run while the engine is busy. Auto-commit reads can overlap on engine
211
+ snapshots; write commits and explicit read-write transactions serialize.
180
212
 
181
213
  The engine has no cancellation hook, so we pass a `NULL` unblock
182
214
  function. A thread interrupted mid-query (`Thread#kill`) will observe
@@ -186,7 +218,7 @@ if you rely on cooperative cancellation.
186
218
  ## Local development
187
219
 
188
220
  ```bash
189
- cd crates/lora-ruby
221
+ cd crates/bindings/lora-ruby
190
222
  bundle install
191
223
  bundle exec rake compile # cargo build → lib/lora_ruby/lora_ruby.<ext>
192
224
  bundle exec rake test # minitest
@@ -201,7 +233,7 @@ precompiled platform gem.
201
233
 
202
234
  ```
203
235
  lora-database (Rust, embedded)
204
- └── crates/lora-ruby/ (gem root + cargo crate)
236
+ └── crates/bindings/lora-ruby/ (gem root + cargo crate)
205
237
  ├── Cargo.toml Rust workspace member
206
238
  ├── extconf.rb rb-sys / mkmf entry point
207
239
  ├── src/lib.rs <- Magnus / rb-sys bindings
Binary file
Binary file
Binary file
@@ -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.6.0" unless const_defined?(:VERSION)
13
+ VERSION = "0.8.5" unless const_defined?(:VERSION)
14
14
  end
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.6.0
4
+ version: 0.8.5
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - LoraDB, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-29 00:00:00.000000000 Z
11
+ date: 2026-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -73,9 +73,9 @@ licenses:
73
73
  - BUSL-1.1
74
74
  metadata:
75
75
  homepage_uri: https://github.com/lora-db/lora
76
- source_code_uri: https://github.com/lora-db/lora/tree/main/crates/lora-ruby
76
+ source_code_uri: https://github.com/lora-db/lora/tree/main/crates/bindings/lora-ruby
77
77
  bug_tracker_uri: https://github.com/lora-db/lora/issues
78
- documentation_uri: https://github.com/lora-db/lora/blob/main/crates/lora-ruby/README.md
78
+ documentation_uri: https://github.com/lora-db/lora/blob/main/crates/bindings/lora-ruby/README.md
79
79
  rubygems_mfa_required: 'true'
80
80
  post_install_message:
81
81
  rdoc_options: []