@nxtedition/rocksdb 7.0.65 → 7.0.67

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
@@ -18,6 +18,7 @@
18
18
  #include <rocksdb/table.h>
19
19
  #include <rocksdb/write_batch.h>
20
20
 
21
+ #include <iostream>
21
22
  #include <memory>
22
23
  #include <optional>
23
24
  #include <set>
@@ -594,8 +595,12 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
594
595
  std::optional<std::string> mergeOperatorOpt;
595
596
  NAPI_STATUS_RETURN(GetProperty(env, options, "mergeOperator", mergeOperatorOpt));
596
597
  if (mergeOperatorOpt) {
597
- ROCKS_STATUS_RETURN_NAPI(
598
- rocksdb::MergeOperator::CreateFromString(configOptions, *mergeOperatorOpt, &columnOptions.merge_operator));
598
+ if (*mergeOperatorOpt == "maxRev") {
599
+ columnOptions.merge_operator = std::make_shared<MaxRevOperator>();
600
+ } else {
601
+ ROCKS_STATUS_RETURN_NAPI(
602
+ rocksdb::MergeOperator::CreateFromString(configOptions, *mergeOperatorOpt, &columnOptions.merge_operator));
603
+ }
599
604
  }
600
605
 
601
606
  uint32_t cacheSize = 8 << 20;
@@ -1,5 +1,8 @@
1
1
  #pragma once
2
2
 
3
+ #include <rocksdb/slice.h>
4
+ #include <rocksdb/merge_operator.h>
5
+
3
6
  int compareRev(const rocksdb::Slice& a, const rocksdb::Slice& b) {
4
7
  auto indexA = 0UL;
5
8
  auto indexB = 0UL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "7.0.65",
3
+ "version": "7.0.67",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
Binary file