@nxtedition/rocksdb 7.0.36 → 7.0.39
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 +15 -2
- package/chained-batch.js +4 -0
- package/index.js +2 -2
- package/iterator.js +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
package/binding.cc
CHANGED
|
@@ -1528,7 +1528,7 @@ NAPI_METHOD(db_get_latest_sequence) {
|
|
|
1528
1528
|
const auto seq = database->db_->GetLatestSequenceNumber();
|
|
1529
1529
|
|
|
1530
1530
|
napi_value result;
|
|
1531
|
-
NAPI_STATUS_THROWS(
|
|
1531
|
+
NAPI_STATUS_THROWS(napi_create_int64(env, seq, &result));
|
|
1532
1532
|
|
|
1533
1533
|
return result;
|
|
1534
1534
|
}
|
|
@@ -1609,7 +1609,7 @@ NAPI_METHOD(iterator_get_sequence) {
|
|
|
1609
1609
|
const auto seq = iterator->snapshot_->GetSequenceNumber();
|
|
1610
1610
|
|
|
1611
1611
|
napi_value result;
|
|
1612
|
-
NAPI_STATUS_THROWS(
|
|
1612
|
+
NAPI_STATUS_THROWS(napi_create_int64(env, seq, &result));
|
|
1613
1613
|
|
|
1614
1614
|
return result;
|
|
1615
1615
|
}
|
|
@@ -1900,6 +1900,18 @@ NAPI_METHOD(batch_merge) {
|
|
|
1900
1900
|
return 0;
|
|
1901
1901
|
}
|
|
1902
1902
|
|
|
1903
|
+
NAPI_METHOD(batch_count) {
|
|
1904
|
+
NAPI_ARGV(2);
|
|
1905
|
+
|
|
1906
|
+
rocksdb::WriteBatch* batch;
|
|
1907
|
+
NAPI_STATUS_THROWS(napi_get_value_external(env, argv[1], reinterpret_cast<void**>(&batch)));
|
|
1908
|
+
|
|
1909
|
+
napi_value result;
|
|
1910
|
+
NAPI_STATUS_THROWS(napi_create_int64(env, batch->Count(), &result));
|
|
1911
|
+
|
|
1912
|
+
return result;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1903
1915
|
NAPI_METHOD(db_flush_wal) {
|
|
1904
1916
|
NAPI_ARGV(2);
|
|
1905
1917
|
|
|
@@ -2009,4 +2021,5 @@ NAPI_INIT() {
|
|
|
2009
2021
|
NAPI_EXPORT_FUNCTION(batch_write);
|
|
2010
2022
|
NAPI_EXPORT_FUNCTION(batch_put_log_data);
|
|
2011
2023
|
NAPI_EXPORT_FUNCTION(batch_merge);
|
|
2024
|
+
NAPI_EXPORT_FUNCTION(batch_count);
|
|
2012
2025
|
}
|
package/chained-batch.js
CHANGED
|
@@ -48,6 +48,10 @@ class ChainedBatch extends AbstractChainedBatch {
|
|
|
48
48
|
// TODO (fix): Check if open...
|
|
49
49
|
binding.batch_merge(this[kDbContext], this[kBatchContext], key, value, options)
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
get count () {
|
|
53
|
+
return binding.batch_count(this[kDbContext], this[kBatchContext])
|
|
54
|
+
}
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
exports.ChainedBatch = ChainedBatch
|
package/index.js
CHANGED
|
@@ -60,7 +60,7 @@ class RocksLevel extends AbstractLevel {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
get sequence () {
|
|
63
|
-
return
|
|
63
|
+
return binding.db_get_latest_sequence(this[kContext])
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
get location () {
|
|
@@ -216,7 +216,7 @@ class RocksLevel extends AbstractLevel {
|
|
|
216
216
|
} else {
|
|
217
217
|
resolve({
|
|
218
218
|
rows,
|
|
219
|
-
sequence:
|
|
219
|
+
sequence: binding.iterator_get_sequence(context),
|
|
220
220
|
finished
|
|
221
221
|
})
|
|
222
222
|
}
|
package/iterator.js
CHANGED
package/package.json
CHANGED
|
Binary file
|