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 +4 -4
- data/lib/virgodb/table.rb +27 -2
- data/lib/virgodb/version.rb +1 -1
- data/lib/virgodb/virgodb_ruby.so +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2ae3df4e1bd12518405cae2835a703b0f4ffd508ccbbf5ebe43c432ef7ef0ec7
|
|
4
|
+
data.tar.gz: f17c77aeb4c20b82b4dc783855b781812558bb4d534fd670925e7b7b32cced0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
83
|
-
|
|
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
|
data/lib/virgodb/version.rb
CHANGED
data/lib/virgodb/virgodb_ruby.so
CHANGED
|
Binary file
|