virgodb 0.5.1-x86_64-linux-gnu → 0.6.0-x86_64-linux-gnu

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: 84c5bd3024d1cd653342071841dba324e875bbb3df3a549ab216e174b665eb9f
4
- data.tar.gz: f54a1ee99de273157fc040301f3b6674df643f925c33384cd6387b28cebd4dc1
3
+ metadata.gz: 2ae3df4e1bd12518405cae2835a703b0f4ffd508ccbbf5ebe43c432ef7ef0ec7
4
+ data.tar.gz: f17c77aeb4c20b82b4dc783855b781812558bb4d534fd670925e7b7b32cced0f
5
5
  SHA512:
6
- metadata.gz: 7d8e3cf76764d4d2ea51cb174e79866bdd2e28197c4a79c6ef94fd8245cdc2cded8fbd47afc89f384363ed7fdea98299148c8640223353964a2e683ad1a0cbbd
7
- data.tar.gz: 45e3d4da2103f8b17fd512e2a4579b02a1c0c12b26a917f3842d4d135bc7e555e1e391bbf29ac21f69aca89e7b37aa9f2738b9aff92f1c01f3e47eca5724195c
6
+ metadata.gz: f0342ce496251be7abedb295a04111b7c19b830bd1fa89c030b681329358f07d2d7e0c956d3dfa9284a2488d390195f8d165ab170acc6e94c707eb7ba0e82c79
7
+ data.tar.gz: 011140aedef62e2ccd5dc9d1dcf19e1b63d89bb3a496d8e2c32388ea366c0cb996e56c61fd4b3cad25ec52e4a22a5583de95f097629435d266be268444d6fc69
data/lib/virgodb/table.rb CHANGED
@@ -79,8 +79,18 @@ module Virgodb
79
79
  # might use for it. Not mutex-guarded -- a read never touches the
80
80
  # Writer's RefCell state at all (Virgodb.query is a separate, already
81
81
  # GVL-released, independently-safe-for-concurrency FFI entry point).
82
- def query(sql, partition_keys: nil)
83
- JSON.parse(Virgodb.query(@manifest_path, @sql_table_name, sql, partition_keys))
82
+ #
83
+ # `params`: optional Array of positional bind parameters -- `sql` refers
84
+ # to them as `$1`, `$2`, ... (matching array order), same convention SQL
85
+ # engines with positional placeholders already use. Purely additive and
86
+ # opt-in -- omit it (the default) and this behaves exactly as before,
87
+ # raw-SQL interpolation, `caller's job to do it safely`. Each element
88
+ # must be nil-free (a bind param can't express NULL -- use IS NULL/IS
89
+ # NOT NULL directly in `sql` instead) and one of String/Integer/Float/
90
+ # true/false; anything else raises. Prefer this over interpolating an
91
+ # untrusted value (e.g. something a user typed) directly into `sql`.
92
+ def query(sql, partition_keys: nil, params: nil)
93
+ JSON.parse(Virgodb.query(@manifest_path, @sql_table_name, sql, partition_keys, params && params.to_json))
84
94
  end
85
95
 
86
96
  def flush!
@@ -132,6 +142,21 @@ module Virgodb
132
142
  Virgodb.snapshot(@manifest_path, dest_path)
133
143
  end
134
144
 
145
+ # Rewrites every run_files/inline_batches path under old_prefix to the
146
+ # same relative path under new_prefix, through virgodb's own connection
147
+ # -- same "don't use a second connection type against this shared file"
148
+ # reasoning as snapshot/integrity_check above. Manifest-scoped, not
149
+ # table-scoped: intended for disaster-recovery restore tooling, right
150
+ # after a manifest and its data directory have been physically moved or
151
+ # restored to a new absolute path, before virgodb starts reading again.
152
+ # Returns [run_files_updated, inline_batches_updated]. See
153
+ # Manifest::relocate_data_dir's own doc comment (crates/manifest/src/lib.rs)
154
+ # for the matching rules and what's deliberately left untouched
155
+ # (orphaned_files).
156
+ def relocate_data_dir(old_prefix, new_prefix)
157
+ Virgodb.relocate_data_dir(@manifest_path, old_prefix, new_prefix)
158
+ end
159
+
135
160
  # Claims this table's maintenance lease as `holder` for the next
136
161
  # `lease_duration_secs` seconds, locking out the real maintenance
137
162
  # thread (its own claim attempts fail against an unexpired lease the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Virgodb
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virgodb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: x86_64-linux-gnu
6
6
  authors:
7
7
  - virgodb