@nxtedition/rocksdb 7.0.10 → 7.0.11
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 +16 -0
- package/index.js +4 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
package/binding.cc
CHANGED
|
@@ -1395,6 +1395,21 @@ NAPI_METHOD(db_get_property) {
|
|
|
1395
1395
|
return result;
|
|
1396
1396
|
}
|
|
1397
1397
|
|
|
1398
|
+
|
|
1399
|
+
NAPI_METHOD(db_get_latest_sequence) {
|
|
1400
|
+
NAPI_ARGV(1);
|
|
1401
|
+
|
|
1402
|
+
Database* database;
|
|
1403
|
+
NAPI_STATUS_THROWS(napi_get_value_external(env, argv[0], reinterpret_cast<void**>(&database)));
|
|
1404
|
+
|
|
1405
|
+
const auto seq = database->db_->GetLatestSequenceNumber();
|
|
1406
|
+
|
|
1407
|
+
napi_value result;
|
|
1408
|
+
NAPI_STATUS_THROWS(napi_create_bigint_int64(env, seq, &result));
|
|
1409
|
+
|
|
1410
|
+
return result;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1398
1413
|
NAPI_METHOD(iterator_init) {
|
|
1399
1414
|
NAPI_ARGV(2);
|
|
1400
1415
|
|
|
@@ -1716,6 +1731,7 @@ NAPI_INIT() {
|
|
|
1716
1731
|
NAPI_EXPORT_FUNCTION(db_del);
|
|
1717
1732
|
NAPI_EXPORT_FUNCTION(db_clear);
|
|
1718
1733
|
NAPI_EXPORT_FUNCTION(db_get_property);
|
|
1734
|
+
NAPI_EXPORT_FUNCTION(db_get_latest_sequence);
|
|
1719
1735
|
|
|
1720
1736
|
NAPI_EXPORT_FUNCTION(iterator_init);
|
|
1721
1737
|
NAPI_EXPORT_FUNCTION(iterator_seek);
|
package/index.js
CHANGED
package/package.json
CHANGED
|
Binary file
|