document-dataply 0.0.10-alpha.0 → 0.0.10-alpha.2
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 +16 -14
- package/dist/types/core/bptree/documentComparator.d.ts +0 -1
- package/package.json +3 -3
- package/readme.md +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -9153,10 +9153,15 @@ var require_cjs = __commonJS({
|
|
|
9153
9153
|
}
|
|
9154
9154
|
const metadataPage = await this.pfs.getMetadata(tx);
|
|
9155
9155
|
const manager = this.factory.getManagerFromType(MetadataPageManager.CONSTANT.PAGE_TYPE_METADATA);
|
|
9156
|
+
const pageSize = manager.getPageSize(metadataPage);
|
|
9157
|
+
const pageCount = manager.getPageCount(metadataPage);
|
|
9158
|
+
const rowCount = manager.getRowCount(metadataPage);
|
|
9159
|
+
const usage = pageCount / Math.pow(2, 32);
|
|
9156
9160
|
return {
|
|
9157
|
-
pageSize
|
|
9158
|
-
pageCount
|
|
9159
|
-
rowCount
|
|
9161
|
+
pageSize,
|
|
9162
|
+
pageCount,
|
|
9163
|
+
rowCount,
|
|
9164
|
+
usage
|
|
9160
9165
|
};
|
|
9161
9166
|
}
|
|
9162
9167
|
/**
|
|
@@ -10238,9 +10243,11 @@ var require_cjs = __commonJS({
|
|
|
10238
10243
|
if (!this.initialized) {
|
|
10239
10244
|
throw new Error("Dataply instance is not initialized");
|
|
10240
10245
|
}
|
|
10241
|
-
return this.
|
|
10242
|
-
|
|
10243
|
-
|
|
10246
|
+
return this.runWithDefaultWrite(() => {
|
|
10247
|
+
return this.hook.trigger("close", void 0, async () => {
|
|
10248
|
+
await this.pfs.close();
|
|
10249
|
+
import_node_fs3.default.closeSync(this.fileHandle);
|
|
10250
|
+
});
|
|
10244
10251
|
});
|
|
10245
10252
|
}
|
|
10246
10253
|
};
|
|
@@ -10458,11 +10465,6 @@ var DocumentSerializeStrategyAsync = class extends import_dataply.SerializeStrat
|
|
|
10458
10465
|
// src/core/bptree/documentComparator.ts
|
|
10459
10466
|
var import_dataply2 = __toESM(require_cjs());
|
|
10460
10467
|
var DocumentValueComparator = class extends import_dataply2.ValueComparator {
|
|
10461
|
-
_intlComparator = new Intl.Collator(void 0, {
|
|
10462
|
-
numeric: true,
|
|
10463
|
-
sensitivity: "variant",
|
|
10464
|
-
usage: "sort"
|
|
10465
|
-
});
|
|
10466
10468
|
primaryAsc(a, b) {
|
|
10467
10469
|
return this._compareValue(a.v, b.v);
|
|
10468
10470
|
}
|
|
@@ -10477,10 +10479,10 @@ var DocumentValueComparator = class extends import_dataply2.ValueComparator {
|
|
|
10477
10479
|
* 두 Primitive 값을 비교합니다.
|
|
10478
10480
|
*/
|
|
10479
10481
|
_compareDiff(a, b) {
|
|
10480
|
-
if (typeof a
|
|
10481
|
-
return
|
|
10482
|
+
if (typeof a === "string" && typeof b === "string") {
|
|
10483
|
+
return a.localeCompare(b);
|
|
10482
10484
|
}
|
|
10483
|
-
return
|
|
10485
|
+
return +a - +b;
|
|
10484
10486
|
}
|
|
10485
10487
|
/**
|
|
10486
10488
|
* 두 v 값을 비교합니다. v는 Primitive 또는 Primitive[] (복합 인덱스)일 수 있습니다.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { DataplyTreeValue, Primitive } from '../../types';
|
|
2
2
|
import { ValueComparator } from 'dataply';
|
|
3
3
|
export declare class DocumentValueComparator<T extends DataplyTreeValue<U>, U extends Primitive> extends ValueComparator<T> {
|
|
4
|
-
private readonly _intlComparator;
|
|
5
4
|
primaryAsc(a: T, b: T): number;
|
|
6
5
|
asc(a: T, b: T): number;
|
|
7
6
|
match(value: T): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-dataply",
|
|
3
|
-
"version": "0.0.10-alpha.
|
|
3
|
+
"version": "0.0.10-alpha.2",
|
|
4
4
|
"description": "Simple and powerful JSON document database supporting complex queries and flexible indexing policies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "izure <admin@izure.org>",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dataply"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"dataply": "^0.0.25-alpha.
|
|
45
|
+
"dataply": "^0.0.25-alpha.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/jest": "^30.0.0",
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
"ts-jest": "^29.4.6",
|
|
52
52
|
"typescript": "^5.9.3"
|
|
53
53
|
}
|
|
54
|
-
}
|
|
54
|
+
}
|
package/readme.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
> **This project is currently in the Alpha stage.**
|
|
9
9
|
> APIs and internal structures may change significantly between versions. Use with caution in production environments.
|
|
10
10
|
|
|
11
|
-
`document-dataply` is a **pure JavaScript** high-performance document-oriented database library built on top of the [`dataply`](https://github.com/izure1/dataply) record storage engine. It is designed to handle
|
|
11
|
+
`document-dataply` is a **pure JavaScript** high-performance document-oriented database library built on top of the [`dataply`](https://github.com/izure1/dataply) record storage engine. It is designed to handle at least millions of documents with high stability, providing a structured way to store, index, and query JSON-style documents.
|
|
12
12
|
|
|
13
13
|
## Key Features
|
|
14
14
|
|
|
@@ -161,7 +161,7 @@ For detailed usage and error handling patterns, see the [Transaction Guide (TRAN
|
|
|
161
161
|
|
|
162
162
|
### Updating and Deleting
|
|
163
163
|
|
|
164
|
-
`document-dataply` provides flexible ways to update or delete documents based on query results. All these operations are **Stream-based**, allowing you to handle millions of records without memory concerns.
|
|
164
|
+
`document-dataply` provides flexible ways to update or delete documents based on query results. All these operations are **Stream-based**, allowing you to handle at least millions of records without memory concerns.
|
|
165
165
|
|
|
166
166
|
- **Partial Update**: Modify only specific fields or use a function for dynamic updates.
|
|
167
167
|
- **Full Update**: Replace the entire document while preserving the original `_id`.
|