lora-ruby 0.29.0-aarch64-linux → 0.30.0-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: c50d287501e0ffbf3205ce1207988bcef0ab9bd0263731048f0afda75eb442b3
4
- data.tar.gz: 38574f3a73b0ea8d4507c5ea0ea597e6835f2d90581f596991a998dec678febf
3
+ metadata.gz: 06ded44e48accd820487bd5c90d2daeace68e827deb077a7ff246308fcda82e8
4
+ data.tar.gz: 0be65eccfe32d7d16a84084d9b3f518bb650d01cb2118a4637f48f157fa109e6
5
5
  SHA512:
6
- metadata.gz: b4a8458aa8af4b09aeddba871446eb20244675e1810300b3c2b0728fedd4acdecd2ba4befbab64c5b7d14926581451a6490d42d06efbfc8765c3cc6c59d5c8ae
7
- data.tar.gz: 798078999051d78a31dc6b0a306beb9ebc8bd8dea6246ca525e8553888f761a369aeeb3540fdfec4b710942414af7581353ce35263f01709112482eec0c896d1
6
+ metadata.gz: a93b8018a6331b70b4336c2af8af9986ad565a7854ef54acd7acea8a41bcad0589904f0ea0ac12d9d4bb1aa02157c0289051c4cd4b67fc79dfd2ec86651b6b91
7
+ data.tar.gz: 946b85dab6269e48d05c77c16718a28ce660016858925b0099b7f731be12bebdd96a5a9e3332129e1c189ffb69e62fba834b69a17a2e143ea7d03f6852cc8b55
data/README.md CHANGED
@@ -80,9 +80,9 @@ LoraRuby::Database.create(database_name = nil, options = nil) # -> Database
80
80
  LoraRuby::Database.new(database_name = nil, options = nil) # -> Database
81
81
  LoraRuby::Database.open_wal(wal_dir, options = nil) # -> Database
82
82
 
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
83
+ db.execute(query, params = nil, timeout_ms: nil) # -> { "columns" => [...], "rows" => [...] }
84
+ db.explain(query, params = nil) # -> plan Hash; never executes
85
+ db.profile(query, params = nil, timeout_ms: nil) # -> { "plan" => ..., "metrics" => ... }; PROFILE executes writes
86
86
  db.clear # -> nil
87
87
  db.node_count # -> Integer
88
88
  db.relationship_count # -> Integer
@@ -218,12 +218,26 @@ binding has no interactive transactions: each write takes the lock and
218
218
  releases it within one call. So a waiting writer never blocks the writer
219
219
  holding the lock, however many threads write at once.
220
220
 
221
- The engine has no cancellation hook, so we pass a `NULL` unblock
222
- function. A thread interrupted mid-query (`Thread#kill`, `Ctrl-C`) will
223
- observe the interrupt **after** the current call finishes, including a
224
- write that was still waiting for the writer lock (it runs, then the
225
- interrupt fires). Keep queries short if you rely on cooperative
226
- cancellation.
221
+ ### Timeouts and interrupts
222
+
223
+ Pass `timeout_ms:` to bound a query. When the time runs out the query
224
+ stops at its next check point, rolls back any writes, releases its locks,
225
+ and raises `LoraRuby::QueryError` with code `LORA_TIMEOUT`:
226
+
227
+ ```ruby
228
+ db.execute("MATCH (a), (b) RETURN count(*)", nil, timeout_ms: 2_000)
229
+ db.execute("MATCH (n {id: $id}) RETURN n", { id: 1 }, timeout_ms: 500)
230
+ ```
231
+
232
+ A query with `timeout_ms:` can also be interrupted: `Thread#raise`,
233
+ `Thread#kill`, `Timeout.timeout` and `Ctrl-C` cancel it the same way, and
234
+ the interrupt is then raised as usual. A query without `timeout_ms:` runs
235
+ without a deadline (deadline checks cost a little on large scans) and
236
+ observes an interrupt only **after** it finishes.
237
+
238
+ `timeout_ms` is a reserved keyword: other keywords are still accepted as
239
+ query params (`db.execute(q, name: "Ada")`), but a param named
240
+ `timeout_ms` has to go in an explicit params hash.
227
241
 
228
242
  ## Local development
229
243
 
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.29.0" unless const_defined?(:VERSION)
13
+ VERSION = "0.30.0" unless const_defined?(:VERSION)
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lora-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.30.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - LoraDB, Inc.