@nxtedition/rocksdb 10.1.6 → 10.2.0
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.
package/binding.cc
CHANGED
|
@@ -974,10 +974,15 @@ NAPI_METHOD(db_get_many) {
|
|
|
974
974
|
rocksdb::ColumnFamilyHandle* column = database->db->DefaultColumnFamily();
|
|
975
975
|
NAPI_STATUS_THROWS(GetProperty(env, options, "column", column));
|
|
976
976
|
|
|
977
|
+
bool takeSnapshot = true;
|
|
978
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "snapshot", takeSnapshot));
|
|
979
|
+
|
|
977
980
|
auto callback = argv[3];
|
|
978
981
|
|
|
979
|
-
|
|
980
|
-
|
|
982
|
+
std::shared_ptr<const rocksdb::Snapshot> snapshot;
|
|
983
|
+
if (takeSnapshot) {
|
|
984
|
+
snapshot.reset(database->db->GetSnapshot(), [=](const auto ptr) { database->db->ReleaseSnapshot(ptr); });
|
|
985
|
+
}
|
|
981
986
|
|
|
982
987
|
std::vector<rocksdb::PinnableSlice> keys{size};
|
|
983
988
|
|
|
@@ -1230,8 +1235,13 @@ NAPI_METHOD(iterator_init) {
|
|
|
1230
1235
|
rocksdb::ColumnFamilyHandle* column = database->db->DefaultColumnFamily();
|
|
1231
1236
|
NAPI_STATUS_THROWS(GetProperty(env, options, "column", column));
|
|
1232
1237
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1238
|
+
bool takeSnapshot = !tailing;
|
|
1239
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "snapshot", takeSnapshot));
|
|
1240
|
+
|
|
1241
|
+
std::shared_ptr<const rocksdb::Snapshot> snapshot;
|
|
1242
|
+
if (takeSnapshot) {
|
|
1243
|
+
snapshot.reset(database->db->GetSnapshot(), [=](const auto ptr) { database->db->ReleaseSnapshot(ptr); });
|
|
1244
|
+
}
|
|
1235
1245
|
|
|
1236
1246
|
auto iterator = std::unique_ptr<Iterator>(new Iterator(database, column, reverse, keys, values, limit, lt, lte, gt,
|
|
1237
1247
|
gte, fillCache, keyEncoding, valueEncoding, highWaterMarkBytes,
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|