lora-ruby 0.6.0-x86_64-linux → 0.8.4-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 +4 -4
- data/README.md +38 -6
- data/lib/lora_ruby/3.1/lora_ruby.so +0 -0
- data/lib/lora_ruby/3.2/lora_ruby.so +0 -0
- data/lib/lora_ruby/3.3/lora_ruby.so +0 -0
- data/lib/lora_ruby/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d80ff16c35cd0c2c9a41563b78cf6eb4efd920da2ab37d72db9364b3ab1dbcf2
|
|
4
|
+
data.tar.gz: b05c7f6b6f29cdb116f0f0f6b771074ec613e460905a7a015c8b8705034e6f40
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '028fa90d227cd7b2a97be8c07675ed8991afbec05b22009569373226277cab3548b6a84ee516ee0fa2f8ce045e79b634b175a33de7b73ae02ea631a45cb3998e'
|
|
7
|
+
data.tar.gz: 1f687e32046ead1c082932c4571e38f2da7bb12f4aa5d08f858a17dead2a9fc5c05aa385320cb73dd4854fc7a15dd96c5426018c2c8a5051d188cb6989284a00
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# lora-ruby
|
|
2
2
|
|
|
3
|
-
Ruby bindings for the [Lora](
|
|
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.
|
|
178
|
-
|
|
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
|
data/lib/lora_ruby/version.rb
CHANGED
|
@@ -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.
|
|
13
|
+
VERSION = "0.8.4" 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.
|
|
4
|
+
version: 0.8.4
|
|
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-
|
|
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: []
|