@nxtedition/rocksdb 7.0.26 → 7.0.27

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
@@ -14,6 +14,7 @@
14
14
  #include <rocksdb/slice_transform.h>
15
15
  #include <rocksdb/table.h>
16
16
  #include <rocksdb/write_batch.h>
17
+ #include <rocksdb/merge_operator.h>
17
18
 
18
19
  #include <array>
19
20
  #include <memory>
@@ -701,6 +702,8 @@ struct OpenWorker final : public Worker {
701
702
 
702
703
  template <typename T, typename U>
703
704
  rocksdb::Status InitOptions(napi_env env, T& columnOptions, const U& options) {
705
+ rocksdb::ConfigOptions configOptions;
706
+
704
707
  const auto memtable_memory_budget = Uint32Property(env, options, "memtableMemoryBudget").value_or(256 * 1024 * 1024);
705
708
 
706
709
  const auto compaction = StringProperty(env, options, "compaction").value_or("level");
@@ -746,18 +749,22 @@ rocksdb::Status InitOptions(napi_env env, T& columnOptions, const U& options) {
746
749
 
747
750
  const auto prefixExtractorOpt = StringProperty(env, options, "prefixExtractor");
748
751
  if (prefixExtractorOpt) {
749
- rocksdb::ConfigOptions configOptions;
750
752
  ROCKS_STATUS_RETURN(
751
753
  rocksdb::SliceTransform::CreateFromString(configOptions, *prefixExtractorOpt, &columnOptions.prefix_extractor));
752
754
  }
753
755
 
754
756
  const auto comparatorOpt = StringProperty(env, options, "comparator");
755
757
  if (comparatorOpt) {
756
- rocksdb::ConfigOptions configOptions;
757
758
  ROCKS_STATUS_RETURN(
758
759
  rocksdb::Comparator::CreateFromString(configOptions, *comparatorOpt, &columnOptions.comparator));
759
760
  }
760
761
 
762
+ const auto mergeOperatorOpt = StringProperty(env, options, "mergeOperator");
763
+ if (mergeOperatorOpt) {
764
+ ROCKS_STATUS_RETURN(
765
+ rocksdb::MergeOperator::CreateFromString(configOptions, *mergeOperatorOpt, &columnOptions.merge_operator));
766
+ }
767
+
761
768
  const auto cacheSize = Uint32Property(env, options, "cacheSize").value_or(8 << 20);
762
769
 
763
770
  rocksdb::BlockBasedTableOptions tableOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "7.0.26",
3
+ "version": "7.0.27",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",