dataply 0.0.14 → 0.0.16-alpha.0

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/dist/cjs/index.js CHANGED
@@ -6791,11 +6791,11 @@ var DataplyAPI = class {
6791
6791
  * Retrieves metadata from the dataply.
6792
6792
  * @returns Metadata of the dataply.
6793
6793
  */
6794
- async getMetadata() {
6794
+ async getMetadata(tx) {
6795
6795
  if (!this.initialized) {
6796
6796
  throw new Error("Dataply instance is not initialized");
6797
6797
  }
6798
- return this.runWithDefault((tx) => this.rowTableEngine.getMetadata(tx));
6798
+ return this.runWithDefault((tx2) => this.rowTableEngine.getMetadata(tx2), tx);
6799
6799
  }
6800
6800
  /**
6801
6801
  * Inserts data. Returns the PK of the added row.
@@ -6949,8 +6949,8 @@ var Dataply = class {
6949
6949
  * Retrieves metadata from the dataply.
6950
6950
  * @returns Metadata of the dataply.
6951
6951
  */
6952
- async getMetadata() {
6953
- return this.api.getMetadata();
6952
+ async getMetadata(tx) {
6953
+ return this.api.getMetadata(tx);
6954
6954
  }
6955
6955
  /**
6956
6956
  * Inserts data. Returns the PK of the added row.
@@ -29,7 +29,7 @@ export declare class Dataply {
29
29
  * Retrieves metadata from the dataply.
30
30
  * @returns Metadata of the dataply.
31
31
  */
32
- getMetadata(): Promise<DataplyMetadata>;
32
+ getMetadata(tx?: Transaction): Promise<DataplyMetadata>;
33
33
  /**
34
34
  * Inserts data. Returns the PK of the added row.
35
35
  * @param data Data to add
@@ -96,7 +96,7 @@ export declare class DataplyAPI {
96
96
  * Retrieves metadata from the dataply.
97
97
  * @returns Metadata of the dataply.
98
98
  */
99
- getMetadata(): Promise<DataplyMetadata>;
99
+ getMetadata(tx?: Transaction): Promise<DataplyMetadata>;
100
100
  /**
101
101
  * Inserts data. Returns the PK of the added row.
102
102
  * @param data Data to add
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataply",
3
- "version": "0.0.14",
3
+ "version": "0.0.16-alpha.0",
4
4
  "description": "A lightweight storage engine for Node.js with support for MVCC, WAL.",
5
5
  "license": "MIT",
6
6
  "author": "izure <admin@izure.org>",
package/readme.md CHANGED
@@ -147,7 +147,7 @@ Updates existing data.
147
147
  #### `async delete(pk: number, tx?: Transaction): Promise<void>`
148
148
  Marks data as deleted.
149
149
 
150
- #### `async getMetadata(): Promise<DataplyMetadata>`
150
+ #### `async getMetadata(tx?: Transaction): Promise<DataplyMetadata>`
151
151
  Returns the current metadata of the dataply, including `pageSize`, `pageCount`, and `rowCount`.
152
152
 
153
153
  #### `createTransaction(): Transaction`