@harperfast/rocksdb-js 0.1.14 → 1.0.1

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/README.md CHANGED
@@ -1025,6 +1025,15 @@ Returns an object containing all of the information in the log file.
1025
1025
  - `length: number` The size of the entry data.
1026
1026
  - `timestamp: number` The entry timestamp.
1027
1027
 
1028
+ ### `currentThreadId(): number`
1029
+
1030
+ Returns the current thread ID.
1031
+
1032
+ ```typescript
1033
+ import { currentThreadId } from '@harperfast/rocksdb-js';
1034
+ console.log(currentThreadId());
1035
+ ```
1036
+
1028
1037
  ### `registryStatus(): RegistryStatus`
1029
1038
 
1030
1039
  Returns an array containing that status of all active RocksDB instances.
package/dist/index.cjs CHANGED
@@ -32,7 +32,7 @@ let node_module = require("node:module");
32
32
  let node_path = require("node:path");
33
33
  let node_url = require("node:url");
34
34
  let ordered_binary = require("ordered-binary");
35
- ordered_binary = __toESM(ordered_binary);
35
+ ordered_binary = __toESM(ordered_binary, 1);
36
36
  let _harperfast_extended_iterable = require("@harperfast/extended-iterable");
37
37
  let msgpackr = require("msgpackr");
38
38
 
@@ -87,6 +87,7 @@ const NativeTransaction = binding.Transaction;
87
87
  const TransactionLog = binding.TransactionLog;
88
88
  const registryStatus = binding.registryStatus;
89
89
  const shutdown = binding.shutdown;
90
+ const currentThreadId = binding.currentThreadId;
90
91
  const stats = binding.stats;
91
92
  const version = binding.version;
92
93
 
@@ -1812,14 +1813,12 @@ Object.defineProperty(TransactionLog.prototype, "query", { value({ start, end, e
1812
1813
  }
1813
1814
  }
1814
1815
  while (position < size) {
1815
- do
1816
- try {
1817
- timestamp = dataView.getFloat64(position);
1818
- } catch (error) {
1819
- error.message += ` at position ${position} of log ${logBuffer.logId} (size=${size}, log buffer length=${logBuffer.length})`;
1820
- throw error;
1821
- }
1822
- while (timestamp < 1 && ++position < size);
1816
+ try {
1817
+ timestamp = dataView.getFloat64(position);
1818
+ } catch (error) {
1819
+ error.message += ` at position ${position} of log ${logBuffer.logId} (size=${size}, log buffer length=${logBuffer.length})`;
1820
+ throw error;
1821
+ }
1823
1822
  if (!timestamp) return {
1824
1823
  done: true,
1825
1824
  value: void 0
@@ -1910,7 +1909,7 @@ function loadLastPosition(transactionLog, readUncommitted) {
1910
1909
  //#region src/index.ts
1911
1910
  const versions = {
1912
1911
  rocksdb: version,
1913
- "rocksdb-js": "0.1.14"
1912
+ "rocksdb-js": "1.0.1"
1914
1913
  };
1915
1914
 
1916
1915
  //#endregion
@@ -1921,6 +1920,7 @@ exports.Store = Store;
1921
1920
  exports.Transaction = Transaction;
1922
1921
  exports.TransactionLog = TransactionLog;
1923
1922
  exports.constants = constants;
1923
+ exports.currentThreadId = currentThreadId;
1924
1924
  exports.parseTransactionLog = parseTransactionLog;
1925
1925
  exports.registryStatus = registryStatus;
1926
1926
  exports.shutdown = shutdown;