@fedify/sqlite 1.11.0-dev.86 → 2.0.0-dev.100
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/LICENSE +1 -1
- package/deno.json +1 -1
- package/dist/dist/sqlite.node.d.cts +2 -0
- package/dist/kv.d.cts +3 -3
- package/package.json +4 -4
- package/src/kv.test.ts +4 -4
package/LICENSE
CHANGED
package/deno.json
CHANGED
package/dist/kv.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DatabaseSync } from "./dist/sqlite.node.cjs";
|
|
2
2
|
import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions } from "@fedify/fedify";
|
|
3
3
|
|
|
4
4
|
//#region src/kv.d.ts
|
|
@@ -37,14 +37,14 @@ interface SqliteKvStoreOptions {
|
|
|
37
37
|
*/
|
|
38
38
|
declare class SqliteKvStore implements KvStore {
|
|
39
39
|
#private;
|
|
40
|
-
readonly db:
|
|
40
|
+
readonly db: DatabaseSync;
|
|
41
41
|
readonly options: SqliteKvStoreOptions;
|
|
42
42
|
/**
|
|
43
43
|
* Creates a new SQLite key–value store.
|
|
44
44
|
* @param db The SQLite database to use. Supports `node:sqlite` and `bun:sqlite`.
|
|
45
45
|
* @param options The options for the key–value store.
|
|
46
46
|
*/
|
|
47
|
-
constructor(db:
|
|
47
|
+
constructor(db: DatabaseSync, options?: SqliteKvStoreOptions);
|
|
48
48
|
/**
|
|
49
49
|
* {@inheritDoc KvStore.get}
|
|
50
50
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/sqlite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-dev.100+a9d733cc",
|
|
4
4
|
"description": "SQLite drivers for Fedify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fedify",
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@js-temporal/polyfill": "^0.5.1",
|
|
61
|
-
"@logtape/logtape": "^1.
|
|
61
|
+
"@logtape/logtape": "^1.3.5",
|
|
62
62
|
"es-toolkit": "^1.31.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@fedify/fedify": "^
|
|
65
|
+
"@fedify/fedify": "^2.0.0-dev.100+a9d733cc"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@std/async": "npm:@jsr/std__async@^1.0.13",
|
|
69
69
|
"tsdown": "^0.12.9",
|
|
70
|
-
"typescript": "^5.9.
|
|
70
|
+
"typescript": "^5.9.3"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "tsdown",
|
package/src/kv.test.ts
CHANGED
|
@@ -320,7 +320,7 @@ test("SqliteKvStore.list()", async () => {
|
|
|
320
320
|
await store.set(["other", "x"], "value-x");
|
|
321
321
|
|
|
322
322
|
const entries: { key: readonly string[]; value: unknown }[] = [];
|
|
323
|
-
for await (const entry of store.list
|
|
323
|
+
for await (const entry of store.list(["prefix"])) {
|
|
324
324
|
entries.push({ key: entry.key, value: entry.value });
|
|
325
325
|
}
|
|
326
326
|
|
|
@@ -355,7 +355,7 @@ test("SqliteKvStore.list() - excludes expired", async () => {
|
|
|
355
355
|
await store.set(["list-test", "valid"], "valid-value");
|
|
356
356
|
|
|
357
357
|
const entries: { key: readonly string[]; value: unknown }[] = [];
|
|
358
|
-
for await (const entry of store.list
|
|
358
|
+
for await (const entry of store.list(["list-test"])) {
|
|
359
359
|
entries.push({ key: entry.key, value: entry.value });
|
|
360
360
|
}
|
|
361
361
|
|
|
@@ -374,7 +374,7 @@ test("SqliteKvStore.list() - single element key", async () => {
|
|
|
374
374
|
await store.set(["b"], "value-b");
|
|
375
375
|
|
|
376
376
|
const entries: { key: readonly string[]; value: unknown }[] = [];
|
|
377
|
-
for await (const entry of store.list
|
|
377
|
+
for await (const entry of store.list(["a"])) {
|
|
378
378
|
entries.push({ key: entry.key, value: entry.value });
|
|
379
379
|
}
|
|
380
380
|
|
|
@@ -393,7 +393,7 @@ test("SqliteKvStore.list() - empty prefix", async () => {
|
|
|
393
393
|
await store.set(["d", "e", "f"], "value-def");
|
|
394
394
|
|
|
395
395
|
const entries: { key: readonly string[]; value: unknown }[] = [];
|
|
396
|
-
for await (const entry of store.list
|
|
396
|
+
for await (const entry of store.list()) {
|
|
397
397
|
entries.push({ key: entry.key, value: entry.value });
|
|
398
398
|
}
|
|
399
399
|
|