xitdb 0.3.0 → 0.5.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/README.md +35 -22
- package/dist/index.js +18 -22
- package/dist/read-array-list.d.ts +1 -1
- package/dist/read-cursor.d.ts +1 -2
- package/dist/read-hash-map.d.ts +1 -1
- package/dist/read-hash-set.d.ts +1 -1
- package/dist/read-linked-array-list.d.ts +1 -1
- package/dist/write-array-list.d.ts +1 -1
- package/dist/write-cursor.d.ts +1 -1
- package/dist/write-hash-map.d.ts +1 -1
- package/dist/write-hash-set.d.ts +1 -1
- package/dist/write-linked-array-list.d.ts +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
xitdb is an immutable database written in TypeScript
|
|
3
|
+
<br/>
|
|
4
|
+
<br/>
|
|
5
|
+
<b>Choose your flavor:</b>
|
|
6
|
+
<a href="https://github.com/radarroark/xitdb">Zig</a> |
|
|
7
|
+
<a href="https://github.com/radarroark/xitdb-java">Java</a> |
|
|
8
|
+
<a href="https://github.com/codeboost/xitdb-clj">Clojure</a> |
|
|
9
|
+
<a href="https://github.com/radarroark/xitdb-ts">TypeScript</a>
|
|
10
|
+
</p>
|
|
2
11
|
|
|
3
12
|
* Each transaction efficiently creates a new "copy" of the database, and past copies can still be read from.
|
|
4
13
|
* It supports writing to a file as well as purely in-memory use.
|
|
5
14
|
* No query engine of any kind. You just write data structures (primarily an `ArrayList` and `HashMap`) that can be nested arbitrarily.
|
|
6
15
|
* No dependencies besides the JavaScript standard library.
|
|
7
|
-
*
|
|
16
|
+
* It is available [on npm](https://www.npmjs.com/package/xitdb).
|
|
8
17
|
|
|
9
18
|
This database was originally made for the [xit version control system](https://github.com/radarroark/xit), but I bet it has a lot of potential for other projects. The combination of being immutable and having an API similar to in-memory data structures is pretty powerful. Consider using it [instead of SQLite](https://gist.github.com/radarroark/03a0724484e1111ef4c05d72a935c42c) for your TypeScript projects: it's simpler, it's pure TypeScript, and it creates no impedance mismatch with your program the way SQL databases do.
|
|
10
19
|
|
|
@@ -82,18 +91,18 @@ const moment = await ReadHashMap.create(momentCursor!);
|
|
|
82
91
|
// the cursor to "foo" and then calling readBytes on it
|
|
83
92
|
const fooCursor = await moment.getCursorByString('foo');
|
|
84
93
|
const fooValue = await fooCursor!.readBytes(MAX_READ_BYTES);
|
|
85
|
-
|
|
94
|
+
expect(new TextDecoder().decode(fooValue)).toBe('foo');
|
|
86
95
|
|
|
87
96
|
// to get the "fruits" list, we get the cursor to it and
|
|
88
97
|
// then pass it to the ReadArrayList constructor
|
|
89
98
|
const fruitsCursor = await moment.getCursorByString('fruits');
|
|
90
99
|
const fruits = new ReadArrayList(fruitsCursor!);
|
|
91
|
-
|
|
100
|
+
expect(await fruits.count()).toBe(3);
|
|
92
101
|
|
|
93
102
|
// now we can get the first item from the fruits list and read it
|
|
94
103
|
const appleCursor = await fruits.getCursor(0);
|
|
95
104
|
const appleValue = await appleCursor!.readBytes(MAX_READ_BYTES);
|
|
96
|
-
|
|
105
|
+
expect(new TextDecoder().decode(appleValue)).toBe('apple');
|
|
97
106
|
```
|
|
98
107
|
|
|
99
108
|
## Initializing a Database
|
|
@@ -142,7 +151,7 @@ Then, you can read it like this:
|
|
|
142
151
|
```typescript
|
|
143
152
|
const randomNumberCursor = await moment.getCursorByString('random-number');
|
|
144
153
|
const randomNumber = await randomNumberCursor!.readBytesObject(MAX_READ_BYTES);
|
|
145
|
-
|
|
154
|
+
expect(new TextDecoder().decode(randomNumber.formatTag!)).toBe('bi');
|
|
146
155
|
const randomBigInt = randomNumber.value;
|
|
147
156
|
```
|
|
148
157
|
|
|
@@ -176,12 +185,12 @@ const moment = await ReadHashMap.create(momentCursor!);
|
|
|
176
185
|
// the food list includes the fruits
|
|
177
186
|
const foodCursor = await moment.getCursorByString('food');
|
|
178
187
|
const food = new ReadArrayList(foodCursor!);
|
|
179
|
-
|
|
188
|
+
expect(await food.count()).toBe(6);
|
|
180
189
|
|
|
181
190
|
// ...but the fruits list hasn't been changed
|
|
182
191
|
const fruitsCursor = await moment.getCursorByString('fruits');
|
|
183
192
|
const fruits = new ReadArrayList(fruitsCursor!);
|
|
184
|
-
|
|
193
|
+
expect(await fruits.count()).toBe(3);
|
|
185
194
|
```
|
|
186
195
|
|
|
187
196
|
Before we continue, let's save the latest history index, so we can revert back to this moment of the database later:
|
|
@@ -217,12 +226,12 @@ const moment = await ReadHashMap.create(momentCursor!);
|
|
|
217
226
|
// the cities list contains all four
|
|
218
227
|
const citiesCursor = await moment.getCursorByString('cities');
|
|
219
228
|
const cities = new ReadArrayList(citiesCursor!);
|
|
220
|
-
|
|
229
|
+
expect(await cities.count()).toBe(4);
|
|
221
230
|
|
|
222
231
|
// ..but so does big-cities! we did not intend to mutate this
|
|
223
232
|
const bigCitiesCursor = await moment.getCursorByString('big-cities');
|
|
224
233
|
const bigCities = new ReadArrayList(bigCitiesCursor!);
|
|
225
|
-
|
|
234
|
+
expect(await bigCities.count()).toBe(4);
|
|
226
235
|
```
|
|
227
236
|
|
|
228
237
|
The reason that `big-cities` was mutated is because all data in a given transaction is temporarily mutable. This is a very important optimization, but in this case, it's not what we want.
|
|
@@ -263,12 +272,12 @@ const moment = await ReadHashMap.create(momentCursor!);
|
|
|
263
272
|
// the cities list contains all four
|
|
264
273
|
const citiesCursor = await moment.getCursorByString('cities');
|
|
265
274
|
const cities = new ReadArrayList(citiesCursor!);
|
|
266
|
-
|
|
275
|
+
expect(await cities.count()).toBe(4);
|
|
267
276
|
|
|
268
277
|
// and big-cities only contains the original two
|
|
269
278
|
const bigCitiesCursor = await moment.getCursorByString('big-cities');
|
|
270
279
|
const bigCities = new ReadArrayList(bigCitiesCursor!);
|
|
271
|
-
|
|
280
|
+
expect(await bigCities.count()).toBe(2);
|
|
272
281
|
```
|
|
273
282
|
|
|
274
283
|
## Large Byte Arrays
|
|
@@ -291,10 +300,16 @@ To read a byte array incrementally, get a reader from a cursor:
|
|
|
291
300
|
```typescript
|
|
292
301
|
const longTextCursor = await moment.getCursorByString('long-text');
|
|
293
302
|
const cursorReader = await longTextCursor!.reader();
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
303
|
+
let lineCount = 0, line: number[] = [];
|
|
304
|
+
const buf = new Uint8Array(1024);
|
|
305
|
+
for (let n; (n = await cursorReader.read(buf)) > 0; ) {
|
|
306
|
+
for (let i = 0; i < n; i++) {
|
|
307
|
+
if (buf[i] === 0x0A) { lineCount++; line = []; }
|
|
308
|
+
else line.push(buf[i]);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (line.length > 0) lineCount++;
|
|
312
|
+
expect(lineCount).toBe(50);
|
|
298
313
|
```
|
|
299
314
|
|
|
300
315
|
## Iterators
|
|
@@ -305,13 +320,11 @@ All data structures support iteration. Here's an example of iterating over an `A
|
|
|
305
320
|
const peopleCursor = await moment.getCursorByString('people');
|
|
306
321
|
const people = new ReadArrayList(peopleCursor!);
|
|
307
322
|
|
|
308
|
-
const peopleIter = people.iterator();
|
|
309
|
-
await peopleIter.init();
|
|
323
|
+
const peopleIter = await people.iterator();
|
|
310
324
|
while (await peopleIter.hasNext()) {
|
|
311
325
|
const personCursor = await peopleIter.next();
|
|
312
326
|
const person = await ReadHashMap.create(personCursor!);
|
|
313
|
-
const personIter = person.iterator();
|
|
314
|
-
await personIter.init();
|
|
327
|
+
const personIter = await person.iterator();
|
|
315
328
|
while (await personIter.hasNext()) {
|
|
316
329
|
const kvPairCursor = await personIter.next();
|
|
317
330
|
const kvPair = await kvPairCursor!.readKeyValuePair();
|
|
@@ -358,7 +371,7 @@ The size of the hash in bytes will be stored in the database's header. If you tr
|
|
|
358
371
|
```typescript
|
|
359
372
|
await core.seek(0);
|
|
360
373
|
const header = await Header.read(core);
|
|
361
|
-
|
|
374
|
+
expect(header.hashSize).toBe(20);
|
|
362
375
|
```
|
|
363
376
|
|
|
364
377
|
The hash size alone does not disambiguate hashing algorithms, though. In addition, xitdb reserves four bytes in the header that you can use to put the name of the algorithm. You must provide it in the `Hasher` constructor:
|
|
@@ -372,7 +385,7 @@ The hash id is only written to the database header when it is first initialized.
|
|
|
372
385
|
```typescript
|
|
373
386
|
await core.seek(0);
|
|
374
387
|
const header = await Header.read(core);
|
|
375
|
-
|
|
388
|
+
expect(Hasher.idToString(header.hashId)).toBe("sha1");
|
|
376
389
|
```
|
|
377
390
|
|
|
378
391
|
If you want to use SHA-256, I recommend using `sha2` as the hash id. You can then distinguish between SHA-256 and SHA-512 using the hash size, like this:
|
package/dist/index.js
CHANGED
|
@@ -332,14 +332,10 @@ class CursorIterator {
|
|
|
332
332
|
index = 0;
|
|
333
333
|
stack = [];
|
|
334
334
|
nextCursorMaybe = null;
|
|
335
|
-
initialized = false;
|
|
336
335
|
constructor(cursor) {
|
|
337
336
|
this.cursor = cursor;
|
|
338
337
|
}
|
|
339
338
|
async init() {
|
|
340
|
-
if (this.initialized)
|
|
341
|
-
return;
|
|
342
|
-
this.initialized = true;
|
|
343
339
|
switch (this.cursor.slotPtr.slot.tag) {
|
|
344
340
|
case 0 /* NONE */:
|
|
345
341
|
this.size = 0;
|
|
@@ -400,7 +396,6 @@ class CursorIterator {
|
|
|
400
396
|
return [new IteratorLevel(position, indexBlock, 0)];
|
|
401
397
|
}
|
|
402
398
|
async hasNext() {
|
|
403
|
-
await this.init();
|
|
404
399
|
switch (this.cursor.slotPtr.slot.tag) {
|
|
405
400
|
case 0 /* NONE */:
|
|
406
401
|
return false;
|
|
@@ -421,7 +416,6 @@ class CursorIterator {
|
|
|
421
416
|
}
|
|
422
417
|
}
|
|
423
418
|
async next() {
|
|
424
|
-
await this.init();
|
|
425
419
|
switch (this.cursor.slotPtr.slot.tag) {
|
|
426
420
|
case 0 /* NONE */:
|
|
427
421
|
return null;
|
|
@@ -695,8 +689,7 @@ var init_read_cursor = __esm(() => {
|
|
|
695
689
|
}
|
|
696
690
|
}
|
|
697
691
|
async* [Symbol.asyncIterator]() {
|
|
698
|
-
const iterator =
|
|
699
|
-
await iterator.init();
|
|
692
|
+
const iterator = await this.iterator();
|
|
700
693
|
while (await iterator.hasNext()) {
|
|
701
694
|
const next = await iterator.next();
|
|
702
695
|
if (next !== null) {
|
|
@@ -704,8 +697,10 @@ var init_read_cursor = __esm(() => {
|
|
|
704
697
|
}
|
|
705
698
|
}
|
|
706
699
|
}
|
|
707
|
-
iterator() {
|
|
708
|
-
|
|
700
|
+
async iterator() {
|
|
701
|
+
const iterator = new CursorIterator(this);
|
|
702
|
+
await iterator.init();
|
|
703
|
+
return iterator;
|
|
709
704
|
}
|
|
710
705
|
};
|
|
711
706
|
});
|
|
@@ -818,8 +813,7 @@ var init_write_cursor = __esm(() => {
|
|
|
818
813
|
return new Writer(this, 0, new Slot(ptrPos, 6 /* BYTES */), startPosition, 0);
|
|
819
814
|
}
|
|
820
815
|
async* [Symbol.asyncIterator]() {
|
|
821
|
-
const iterator =
|
|
822
|
-
await iterator.init();
|
|
816
|
+
const iterator = await this.iterator();
|
|
823
817
|
while (await iterator.hasNext()) {
|
|
824
818
|
const next = await iterator.next();
|
|
825
819
|
if (next !== null) {
|
|
@@ -827,8 +821,10 @@ var init_write_cursor = __esm(() => {
|
|
|
827
821
|
}
|
|
828
822
|
}
|
|
829
823
|
}
|
|
830
|
-
iterator() {
|
|
831
|
-
|
|
824
|
+
async iterator() {
|
|
825
|
+
const iterator = new WriteCursorIterator(this);
|
|
826
|
+
await iterator.init();
|
|
827
|
+
return iterator;
|
|
832
828
|
}
|
|
833
829
|
};
|
|
834
830
|
WriteCursorIterator = class WriteCursorIterator extends CursorIterator {
|
|
@@ -3197,7 +3193,7 @@ class ReadArrayList {
|
|
|
3197
3193
|
async count() {
|
|
3198
3194
|
return this.cursor.count();
|
|
3199
3195
|
}
|
|
3200
|
-
iterator() {
|
|
3196
|
+
async iterator() {
|
|
3201
3197
|
return this.cursor.iterator();
|
|
3202
3198
|
}
|
|
3203
3199
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3221,7 +3217,7 @@ class WriteArrayList extends ReadArrayList {
|
|
|
3221
3217
|
const newCursor = await cursor.writePath([new ArrayListInit]);
|
|
3222
3218
|
return new WriteArrayList(newCursor);
|
|
3223
3219
|
}
|
|
3224
|
-
iterator() {
|
|
3220
|
+
async iterator() {
|
|
3225
3221
|
return this.cursor.iterator();
|
|
3226
3222
|
}
|
|
3227
3223
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3280,7 +3276,7 @@ class ReadHashMap {
|
|
|
3280
3276
|
slot() {
|
|
3281
3277
|
return this.cursor.slot();
|
|
3282
3278
|
}
|
|
3283
|
-
iterator() {
|
|
3279
|
+
async iterator() {
|
|
3284
3280
|
return this.cursor.iterator();
|
|
3285
3281
|
}
|
|
3286
3282
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3362,7 +3358,7 @@ class WriteHashMap extends ReadHashMap {
|
|
|
3362
3358
|
map.cursor = newCursor;
|
|
3363
3359
|
return map;
|
|
3364
3360
|
}
|
|
3365
|
-
iterator() {
|
|
3361
|
+
async iterator() {
|
|
3366
3362
|
return this.cursor.iterator();
|
|
3367
3363
|
}
|
|
3368
3364
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3470,7 +3466,7 @@ class ReadHashSet {
|
|
|
3470
3466
|
slot() {
|
|
3471
3467
|
return this.cursor.slot();
|
|
3472
3468
|
}
|
|
3473
|
-
iterator() {
|
|
3469
|
+
async iterator() {
|
|
3474
3470
|
return this.cursor.iterator();
|
|
3475
3471
|
}
|
|
3476
3472
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3514,7 +3510,7 @@ class WriteHashSet extends ReadHashSet {
|
|
|
3514
3510
|
set.cursor = newCursor;
|
|
3515
3511
|
return set;
|
|
3516
3512
|
}
|
|
3517
|
-
iterator() {
|
|
3513
|
+
async iterator() {
|
|
3518
3514
|
return this.cursor.iterator();
|
|
3519
3515
|
}
|
|
3520
3516
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3591,7 +3587,7 @@ class ReadLinkedArrayList {
|
|
|
3591
3587
|
async count() {
|
|
3592
3588
|
return this.cursor.count();
|
|
3593
3589
|
}
|
|
3594
|
-
iterator() {
|
|
3590
|
+
async iterator() {
|
|
3595
3591
|
return this.cursor.iterator();
|
|
3596
3592
|
}
|
|
3597
3593
|
async* [Symbol.asyncIterator]() {
|
|
@@ -3615,7 +3611,7 @@ class WriteLinkedArrayList extends ReadLinkedArrayList {
|
|
|
3615
3611
|
const newCursor = await cursor.writePath([new LinkedArrayListInit]);
|
|
3616
3612
|
return new WriteLinkedArrayList(newCursor);
|
|
3617
3613
|
}
|
|
3618
|
-
iterator() {
|
|
3614
|
+
async iterator() {
|
|
3619
3615
|
return this.cursor.iterator();
|
|
3620
3616
|
}
|
|
3621
3617
|
async* [Symbol.asyncIterator]() {
|
|
@@ -6,7 +6,7 @@ export declare class ReadArrayList implements Slotted {
|
|
|
6
6
|
constructor(cursor: ReadCursor);
|
|
7
7
|
slot(): Slot;
|
|
8
8
|
count(): Promise<number>;
|
|
9
|
-
iterator(): CursorIterator
|
|
9
|
+
iterator(): Promise<CursorIterator>;
|
|
10
10
|
[Symbol.asyncIterator](): AsyncIterator<ReadCursor>;
|
|
11
11
|
getCursor(index: number): Promise<ReadCursor | null>;
|
|
12
12
|
getSlot(index: number): Promise<Slot | null>;
|
package/dist/read-cursor.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare class ReadCursor implements Slotted {
|
|
|
25
25
|
reader(): Promise<Reader>;
|
|
26
26
|
count(): Promise<number>;
|
|
27
27
|
[Symbol.asyncIterator](): AsyncIterator<ReadCursor>;
|
|
28
|
-
iterator(): CursorIterator
|
|
28
|
+
iterator(): Promise<CursorIterator>;
|
|
29
29
|
}
|
|
30
30
|
export declare class Reader {
|
|
31
31
|
parent: ReadCursor;
|
|
@@ -47,7 +47,6 @@ export declare class CursorIterator {
|
|
|
47
47
|
index: number;
|
|
48
48
|
private stack;
|
|
49
49
|
private nextCursorMaybe;
|
|
50
|
-
private initialized;
|
|
51
50
|
constructor(cursor: ReadCursor);
|
|
52
51
|
init(): Promise<void>;
|
|
53
52
|
private initStack;
|
package/dist/read-hash-map.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class ReadHashMap implements Slotted {
|
|
|
7
7
|
protected constructor();
|
|
8
8
|
static create(cursor: ReadCursor): Promise<ReadHashMap>;
|
|
9
9
|
slot(): Slot;
|
|
10
|
-
iterator(): CursorIterator
|
|
10
|
+
iterator(): Promise<CursorIterator>;
|
|
11
11
|
[Symbol.asyncIterator](): AsyncIterator<ReadCursor>;
|
|
12
12
|
getCursorByString(key: string): Promise<ReadCursor | null>;
|
|
13
13
|
getSlotByString(key: string): Promise<Slot | null>;
|
package/dist/read-hash-set.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class ReadHashSet implements Slotted {
|
|
|
7
7
|
protected constructor();
|
|
8
8
|
static create(cursor: ReadCursor): Promise<ReadHashSet>;
|
|
9
9
|
slot(): Slot;
|
|
10
|
-
iterator(): CursorIterator
|
|
10
|
+
iterator(): Promise<CursorIterator>;
|
|
11
11
|
[Symbol.asyncIterator](): AsyncIterator<ReadCursor>;
|
|
12
12
|
getCursorByString(key: string): Promise<ReadCursor | null>;
|
|
13
13
|
getSlotByString(key: string): Promise<Slot | null>;
|
|
@@ -6,7 +6,7 @@ export declare class ReadLinkedArrayList implements Slotted {
|
|
|
6
6
|
constructor(cursor: ReadCursor);
|
|
7
7
|
slot(): Slot;
|
|
8
8
|
count(): Promise<number>;
|
|
9
|
-
iterator(): CursorIterator
|
|
9
|
+
iterator(): Promise<CursorIterator>;
|
|
10
10
|
[Symbol.asyncIterator](): AsyncIterator<ReadCursor>;
|
|
11
11
|
getCursor(index: number): Promise<ReadCursor | null>;
|
|
12
12
|
getSlot(index: number): Promise<Slot | null>;
|
|
@@ -5,7 +5,7 @@ import type { WriteableData } from './writeable-data';
|
|
|
5
5
|
export declare class WriteArrayList extends ReadArrayList {
|
|
6
6
|
constructor(cursor: WriteCursor);
|
|
7
7
|
static create(cursor: WriteCursor): Promise<WriteArrayList>;
|
|
8
|
-
iterator(): WriteCursorIterator
|
|
8
|
+
iterator(): Promise<WriteCursorIterator>;
|
|
9
9
|
[Symbol.asyncIterator](): AsyncIterator<WriteCursor>;
|
|
10
10
|
put(index: number, data: WriteableData): Promise<void>;
|
|
11
11
|
putCursor(index: number): Promise<WriteCursor>;
|
package/dist/write-cursor.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class WriteCursor extends ReadCursor {
|
|
|
16
16
|
readKeyValuePair(): Promise<WriteKeyValuePairCursor>;
|
|
17
17
|
writer(): Promise<Writer>;
|
|
18
18
|
[Symbol.asyncIterator](): AsyncIterator<WriteCursor>;
|
|
19
|
-
iterator(): WriteCursorIterator
|
|
19
|
+
iterator(): Promise<WriteCursorIterator>;
|
|
20
20
|
}
|
|
21
21
|
export declare class Writer {
|
|
22
22
|
parent: WriteCursor;
|
package/dist/write-hash-map.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Bytes } from './writeable-data';
|
|
|
5
5
|
export declare class WriteHashMap extends ReadHashMap {
|
|
6
6
|
protected constructor();
|
|
7
7
|
static create(cursor: WriteCursor): Promise<WriteHashMap>;
|
|
8
|
-
iterator(): WriteCursorIterator
|
|
8
|
+
iterator(): Promise<WriteCursorIterator>;
|
|
9
9
|
[Symbol.asyncIterator](): AsyncIterator<WriteCursor>;
|
|
10
10
|
putByString(key: string, data: WriteableData): Promise<void>;
|
|
11
11
|
putCursorByString(key: string): Promise<WriteCursor>;
|
package/dist/write-hash-set.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Bytes } from './writeable-data';
|
|
|
5
5
|
export declare class WriteHashSet extends ReadHashSet {
|
|
6
6
|
protected constructor();
|
|
7
7
|
static create(cursor: WriteCursor): Promise<WriteHashSet>;
|
|
8
|
-
iterator(): WriteCursorIterator
|
|
8
|
+
iterator(): Promise<WriteCursorIterator>;
|
|
9
9
|
[Symbol.asyncIterator](): AsyncIterator<WriteCursor>;
|
|
10
10
|
putByString(key: string): Promise<void>;
|
|
11
11
|
putCursorByString(key: string): Promise<WriteCursor>;
|
|
@@ -5,7 +5,7 @@ import type { WriteableData } from './writeable-data';
|
|
|
5
5
|
export declare class WriteLinkedArrayList extends ReadLinkedArrayList {
|
|
6
6
|
constructor(cursor: WriteCursor);
|
|
7
7
|
static create(cursor: WriteCursor): Promise<WriteLinkedArrayList>;
|
|
8
|
-
iterator(): WriteCursorIterator
|
|
8
|
+
iterator(): Promise<WriteCursorIterator>;
|
|
9
9
|
[Symbol.asyncIterator](): AsyncIterator<WriteCursor>;
|
|
10
10
|
put(index: number, data: WriteableData): Promise<void>;
|
|
11
11
|
putCursor(index: number): Promise<WriteCursor>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xitdb",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "An immutable database
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "An immutable database",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/radarroark/xitdb-ts.git"
|
|
9
|
+
},
|
|
6
10
|
"type": "module",
|
|
7
11
|
"main": "dist/index.js",
|
|
8
12
|
"types": "dist/index.d.ts",
|