@duraxis/core 0.2.0 → 0.3.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/CHANGELOG.md +24 -0
- package/README.md +24 -1
- package/dist/index.cjs +463 -346
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +463 -346
- package/dist/index.js.map +1 -1
- package/dist/indexes/secondary/secondary-index-manager.d.ts +0 -3
- package/dist/security/storage-key-manager.d.ts +1 -0
- package/dist/transactions/transaction.d.ts +8 -1
- package/package.json +4 -4
|
@@ -8,9 +8,7 @@ import type { BPlusTreeNodeIO, ScanMetrics } from "../bptree/bptree-node.js";
|
|
|
8
8
|
export interface SecondaryIndexScanOptions {
|
|
9
9
|
readonly eq?: IndexScalar | readonly IndexScalar[];
|
|
10
10
|
readonly prefix?: readonly IndexScalar[];
|
|
11
|
-
/** Logical range on the component immediately following prefix. */
|
|
12
11
|
readonly range?: SecondaryIndexLogicalRange;
|
|
13
|
-
/** Legacy shorthand: preceding tuple values are treated as an equality prefix. */
|
|
14
12
|
readonly gt?: readonly IndexScalar[];
|
|
15
13
|
readonly gte?: readonly IndexScalar[];
|
|
16
14
|
readonly lt?: readonly IndexScalar[];
|
|
@@ -44,7 +42,6 @@ export declare class SecondaryIndexManager {
|
|
|
44
42
|
private collectChanges;
|
|
45
43
|
private rebuild;
|
|
46
44
|
private resolve;
|
|
47
|
-
/** Ordered, incremental access that never materializes the ID set. */
|
|
48
45
|
scanIds(manifest: Manifest, collection: string, indexName: string, options?: SecondaryIndexScanOptions): AsyncIterable<SecondaryIndexEntry>;
|
|
49
46
|
lookupIds(manifest: Manifest, collection: string, indexName: string, value: IndexScalar | readonly IndexScalar[], limit?: number): Promise<string[]>;
|
|
50
47
|
}
|
|
@@ -9,6 +9,7 @@ export declare class StorageKeyManager {
|
|
|
9
9
|
private readonly commitPattern;
|
|
10
10
|
constructor(namespace?: string);
|
|
11
11
|
validateLogicalKey(key: string): void;
|
|
12
|
+
validatePrimaryKey(key: string): void;
|
|
12
13
|
objectKey(data: Uint8Array): string;
|
|
13
14
|
commitKey(id: string, data: Uint8Array): string;
|
|
14
15
|
validateObjectKey(key: string): void;
|
|
@@ -17,7 +17,7 @@ export type PendingWrite = {
|
|
|
17
17
|
export interface PreparedTransaction {
|
|
18
18
|
readonly snapshot: Snapshot;
|
|
19
19
|
readonly writes: ReadonlyMap<string, PendingWrite>;
|
|
20
|
-
readonly schemaChanges: ReadonlyMap<string, CollectionDefinition>;
|
|
20
|
+
readonly schemaChanges: ReadonlyMap<string, CollectionDefinition | null>;
|
|
21
21
|
}
|
|
22
22
|
export declare class Transaction {
|
|
23
23
|
private readonly storage;
|
|
@@ -41,6 +41,13 @@ export declare class Transaction {
|
|
|
41
41
|
delete(key: string): void;
|
|
42
42
|
defineCollection(definition: CollectionDefinition): void;
|
|
43
43
|
defineCollections(definitions: readonly CollectionDefinition[]): void;
|
|
44
|
+
getCollectionDefinitions(): readonly CollectionDefinition[];
|
|
45
|
+
alterCollection(name: string, definition: CollectionDefinition): void;
|
|
46
|
+
dropCollection(name: string): void;
|
|
47
|
+
getMetadata(namespace: string): Promise<Uint8Array | null>;
|
|
48
|
+
putMetadata(namespace: string, data: Uint8Array): void;
|
|
49
|
+
private metadataKey;
|
|
50
|
+
scanCollection(collection: string): AsyncIterable<QueryRow>;
|
|
44
51
|
addIndex(collection: string, index: SecondaryIndexDefinition): void;
|
|
45
52
|
removeIndex(collection: string, indexName: string): void;
|
|
46
53
|
getDocument(collection: string, id: string): Promise<DocumentRecord | null>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duraxis/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Transactional embedded database engine and query primitives for Duraxis.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "João Paulo Dias <joaopdias.dev@gmail.com>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://github.com/Joaopdiasventura/Duraxis/issues"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=24.15.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
],
|
|
47
47
|
"sideEffects": false,
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@duraxis/storage": "0.1.
|
|
49
|
+
"@duraxis/storage": "0.1.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@duraxis/storage-memory": "0.1.
|
|
52
|
+
"@duraxis/storage-memory": "0.1.3"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "vite build && tsc -p tsconfig.build.json",
|