@fedify/sqlite 2.2.0-dev.613 → 2.2.0-dev.622
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/deno.json +1 -1
- package/dist/adapter.d.ts +0 -1
- package/dist/kv.cjs +10 -16
- package/dist/kv.d.cts +3 -7
- package/dist/kv.d.ts +0 -4
- package/dist/kv.js +4 -10
- package/dist/mod.cjs +5 -7
- package/dist/mod.js +2 -5
- package/dist/mq.cjs +8 -15
- package/dist/mq.d.cts +4 -4
- package/dist/mq.d.ts +1 -1
- package/dist/mq.js +4 -10
- package/dist/sqlite.bun.cjs +5 -9
- package/dist/sqlite.bun.d.cts +1 -1
- package/dist/sqlite.bun.d.ts +1 -1
- package/dist/sqlite.bun.js +3 -7
- package/dist/sqlite.node.cjs +4 -8
- package/dist/sqlite.node.d.cts +1 -1
- package/dist/sqlite.node.d.ts +1 -1
- package/dist/sqlite.node.js +2 -6
- package/package.json +5 -5
- package/tsdown.config.ts +6 -0
- package/dist/_virtual/rolldown_runtime.cjs +0 -33
- package/dist/dist/sqlite.node.d.cts +0 -2
package/deno.json
CHANGED
package/dist/adapter.d.ts
CHANGED
package/dist/kv.cjs
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const __logtape_logtape = require_rolldown_runtime.__toESM(require("@logtape/logtape"));
|
|
7
|
-
const es_toolkit = require_rolldown_runtime.__toESM(require("es-toolkit"));
|
|
8
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
let _sqlite = require("#sqlite");
|
|
4
|
+
let _logtape_logtape = require("@logtape/logtape");
|
|
5
|
+
let es_toolkit = require("es-toolkit");
|
|
9
6
|
//#region src/kv.ts
|
|
10
|
-
const logger = (0,
|
|
7
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
11
8
|
"fedify",
|
|
12
9
|
"sqlite",
|
|
13
10
|
"kv"
|
|
@@ -42,7 +39,7 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
42
39
|
constructor(db, options = {}) {
|
|
43
40
|
this.db = db;
|
|
44
41
|
this.options = options;
|
|
45
|
-
this.#db = new
|
|
42
|
+
this.#db = new _sqlite.SqliteDatabase(db);
|
|
46
43
|
this.#initialized = options.initialized ?? false;
|
|
47
44
|
this.#tableName = options.tableName ?? SqliteKvStore.#defaultTableName;
|
|
48
45
|
if (!SqliteKvStore.#tableNameRegex.test(this.#tableName)) throw new Error(`Invalid table name for the key–value store: ${this.#tableName}`);
|
|
@@ -59,7 +56,7 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
59
56
|
FROM "${this.#tableName}"
|
|
60
57
|
WHERE key = ? AND (expires IS NULL OR expires > ?)
|
|
61
58
|
`).get(encodedKey, now);
|
|
62
|
-
if (!result) return
|
|
59
|
+
if (!result) return;
|
|
63
60
|
return this.#decodeValue(result.value);
|
|
64
61
|
}
|
|
65
62
|
/**
|
|
@@ -78,7 +75,6 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
78
75
|
value = excluded.value,
|
|
79
76
|
expires = excluded.expires`).run(encodedKey, encodedValue, now, expiresAt);
|
|
80
77
|
this.#expire();
|
|
81
|
-
return;
|
|
82
78
|
}
|
|
83
79
|
/**
|
|
84
80
|
* {@inheritDoc KvStore.delete}
|
|
@@ -107,8 +103,7 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
107
103
|
FROM "${this.#tableName}"
|
|
108
104
|
WHERE key = ? AND (expires IS NULL OR expires > ?)
|
|
109
105
|
`).get(encodedKey, now);
|
|
110
|
-
|
|
111
|
-
if (!(0, es_toolkit.isEqual)(currentValue, expectedValue)) {
|
|
106
|
+
if (!(0, es_toolkit.isEqual)(currentResult === void 0 ? void 0 : this.#decodeValue(currentResult.value), expectedValue)) {
|
|
112
107
|
this.#db.exec("ROLLBACK");
|
|
113
108
|
return false;
|
|
114
109
|
}
|
|
@@ -213,6 +208,5 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
213
208
|
return JSON.parse(value);
|
|
214
209
|
}
|
|
215
210
|
};
|
|
216
|
-
|
|
217
211
|
//#endregion
|
|
218
|
-
exports.SqliteKvStore = SqliteKvStore;
|
|
212
|
+
exports.SqliteKvStore = SqliteKvStore;
|
package/dist/kv.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlatformDatabase } from "#sqlite";
|
|
2
2
|
import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions } from "@fedify/fedify";
|
|
3
3
|
|
|
4
4
|
//#region src/kv.d.ts
|
|
@@ -37,33 +37,29 @@ interface SqliteKvStoreOptions {
|
|
|
37
37
|
*/
|
|
38
38
|
declare class SqliteKvStore implements KvStore {
|
|
39
39
|
#private;
|
|
40
|
-
readonly db:
|
|
40
|
+
readonly db: PlatformDatabase;
|
|
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: PlatformDatabase, options?: SqliteKvStoreOptions);
|
|
48
48
|
/**
|
|
49
49
|
* {@inheritDoc KvStore.get}
|
|
50
50
|
*/
|
|
51
|
-
// deno-lint-ignore require-await
|
|
52
51
|
get<T = unknown>(key: KvKey): Promise<T | undefined>;
|
|
53
52
|
/**
|
|
54
53
|
* {@inheritDoc KvStore.set}
|
|
55
54
|
*/
|
|
56
|
-
// deno-lint-ignore require-await
|
|
57
55
|
set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
|
|
58
56
|
/**
|
|
59
57
|
* {@inheritDoc KvStore.delete}
|
|
60
58
|
*/
|
|
61
|
-
// deno-lint-ignore require-await
|
|
62
59
|
delete(key: KvKey): Promise<void>;
|
|
63
60
|
/**
|
|
64
61
|
* {@inheritDoc KvStore.cas}
|
|
65
62
|
*/
|
|
66
|
-
// deno-lint-ignore require-await
|
|
67
63
|
cas(key: KvKey, expectedValue: unknown, newValue: unknown, options?: KvStoreSetOptions): Promise<boolean>;
|
|
68
64
|
/**
|
|
69
65
|
* {@inheritDoc KvStore.list}
|
package/dist/kv.d.ts
CHANGED
|
@@ -49,22 +49,18 @@ declare class SqliteKvStore implements KvStore {
|
|
|
49
49
|
/**
|
|
50
50
|
* {@inheritDoc KvStore.get}
|
|
51
51
|
*/
|
|
52
|
-
// deno-lint-ignore require-await
|
|
53
52
|
get<T = unknown>(key: KvKey): Promise<T | undefined>;
|
|
54
53
|
/**
|
|
55
54
|
* {@inheritDoc KvStore.set}
|
|
56
55
|
*/
|
|
57
|
-
// deno-lint-ignore require-await
|
|
58
56
|
set(key: KvKey, value: unknown, options?: KvStoreSetOptions): Promise<void>;
|
|
59
57
|
/**
|
|
60
58
|
* {@inheritDoc KvStore.delete}
|
|
61
59
|
*/
|
|
62
|
-
// deno-lint-ignore require-await
|
|
63
60
|
delete(key: KvKey): Promise<void>;
|
|
64
61
|
/**
|
|
65
62
|
* {@inheritDoc KvStore.cas}
|
|
66
63
|
*/
|
|
67
|
-
// deno-lint-ignore require-await
|
|
68
64
|
cas(key: KvKey, expectedValue: unknown, newValue: unknown, options?: KvStoreSetOptions): Promise<boolean>;
|
|
69
65
|
/**
|
|
70
66
|
* {@inheritDoc KvStore.list}
|
package/dist/kv.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
4
2
|
import { SqliteDatabase } from "#sqlite";
|
|
5
3
|
import { getLogger } from "@logtape/logtape";
|
|
6
4
|
import { isEqual } from "es-toolkit";
|
|
7
|
-
|
|
8
5
|
//#region src/kv.ts
|
|
9
6
|
const logger = getLogger([
|
|
10
7
|
"fedify",
|
|
@@ -58,7 +55,7 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
58
55
|
FROM "${this.#tableName}"
|
|
59
56
|
WHERE key = ? AND (expires IS NULL OR expires > ?)
|
|
60
57
|
`).get(encodedKey, now);
|
|
61
|
-
if (!result) return
|
|
58
|
+
if (!result) return;
|
|
62
59
|
return this.#decodeValue(result.value);
|
|
63
60
|
}
|
|
64
61
|
/**
|
|
@@ -77,7 +74,6 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
77
74
|
value = excluded.value,
|
|
78
75
|
expires = excluded.expires`).run(encodedKey, encodedValue, now, expiresAt);
|
|
79
76
|
this.#expire();
|
|
80
|
-
return;
|
|
81
77
|
}
|
|
82
78
|
/**
|
|
83
79
|
* {@inheritDoc KvStore.delete}
|
|
@@ -106,8 +102,7 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
106
102
|
FROM "${this.#tableName}"
|
|
107
103
|
WHERE key = ? AND (expires IS NULL OR expires > ?)
|
|
108
104
|
`).get(encodedKey, now);
|
|
109
|
-
|
|
110
|
-
if (!isEqual(currentValue, expectedValue)) {
|
|
105
|
+
if (!isEqual(currentResult === void 0 ? void 0 : this.#decodeValue(currentResult.value), expectedValue)) {
|
|
111
106
|
this.#db.exec("ROLLBACK");
|
|
112
107
|
return false;
|
|
113
108
|
}
|
|
@@ -212,6 +207,5 @@ var SqliteKvStore = class SqliteKvStore {
|
|
|
212
207
|
return JSON.parse(value);
|
|
213
208
|
}
|
|
214
209
|
};
|
|
215
|
-
|
|
216
210
|
//#endregion
|
|
217
|
-
export { SqliteKvStore };
|
|
211
|
+
export { SqliteKvStore };
|
package/dist/mod.cjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const require_mq = require('./mq.cjs');
|
|
6
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_kv = require("./kv.cjs");
|
|
4
|
+
const require_mq = require("./mq.cjs");
|
|
7
5
|
exports.SqliteKvStore = require_kv.SqliteKvStore;
|
|
8
|
-
exports.SqliteMessageQueue = require_mq.SqliteMessageQueue;
|
|
6
|
+
exports.SqliteMessageQueue = require_mq.SqliteMessageQueue;
|
package/dist/mod.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
4
2
|
import { SqliteKvStore } from "./kv.js";
|
|
5
3
|
import { SqliteMessageQueue } from "./mq.js";
|
|
6
|
-
|
|
7
|
-
export { SqliteKvStore, SqliteMessageQueue };
|
|
4
|
+
export { SqliteKvStore, SqliteMessageQueue };
|
package/dist/mq.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
5
|
-
const __sqlite = require_rolldown_runtime.__toESM(require("#sqlite"));
|
|
6
|
-
const __logtape_logtape = require_rolldown_runtime.__toESM(require("@logtape/logtape"));
|
|
7
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
let _sqlite = require("#sqlite");
|
|
8
4
|
//#region src/mq.ts
|
|
9
|
-
const logger = (0,
|
|
5
|
+
const logger = (0, require("@logtape/logtape").getLogger)([
|
|
10
6
|
"fedify",
|
|
11
7
|
"sqlite",
|
|
12
8
|
"mq"
|
|
@@ -71,7 +67,7 @@ var SqliteMessageQueue = class SqliteMessageQueue {
|
|
|
71
67
|
constructor(db, options = {}) {
|
|
72
68
|
this.db = db;
|
|
73
69
|
this.options = options;
|
|
74
|
-
this.#db = new
|
|
70
|
+
this.#db = new _sqlite.SqliteDatabase(db);
|
|
75
71
|
this.#initialized = options.initialized ?? false;
|
|
76
72
|
this.#tableName = options.tableName ?? SqliteMessageQueue.#defaultTableName;
|
|
77
73
|
this.#instanceId = crypto.randomUUID();
|
|
@@ -313,10 +309,8 @@ var SqliteMessageQueue = class SqliteMessageQueue {
|
|
|
313
309
|
#isBusyError(error) {
|
|
314
310
|
if (!(error instanceof Error)) return false;
|
|
315
311
|
if (error.message.includes("SQLITE_BUSY") || error.message.includes("database is locked") || error.message.includes("transaction within a transaction")) return true;
|
|
316
|
-
|
|
317
|
-
if (
|
|
318
|
-
const errorWithErrno = error;
|
|
319
|
-
if (errorWithErrno.errno === 5) return true;
|
|
312
|
+
if (error.code === "SQLITE_BUSY") return true;
|
|
313
|
+
if (error.errno === 5) return true;
|
|
320
314
|
return false;
|
|
321
315
|
}
|
|
322
316
|
/**
|
|
@@ -388,6 +382,5 @@ var SqliteMessageQueue = class SqliteMessageQueue {
|
|
|
388
382
|
return JSON.parse(message);
|
|
389
383
|
}
|
|
390
384
|
};
|
|
391
|
-
|
|
392
385
|
//#endregion
|
|
393
|
-
exports.SqliteMessageQueue = SqliteMessageQueue;
|
|
386
|
+
exports.SqliteMessageQueue = SqliteMessageQueue;
|
package/dist/mq.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlatformDatabase } from "#sqlite";
|
|
2
2
|
import { MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions } from "@fedify/fedify";
|
|
3
3
|
|
|
4
4
|
//#region src/mq.d.ts
|
|
@@ -65,18 +65,18 @@ interface SqliteMessageQueueOptions {
|
|
|
65
65
|
*/
|
|
66
66
|
declare class SqliteMessageQueue implements MessageQueue, Disposable {
|
|
67
67
|
#private;
|
|
68
|
-
readonly db:
|
|
68
|
+
readonly db: PlatformDatabase;
|
|
69
69
|
readonly options: SqliteMessageQueueOptions;
|
|
70
70
|
/**
|
|
71
71
|
* SQLite message queue does not provide native retry mechanisms.
|
|
72
72
|
*/
|
|
73
|
-
readonly nativeRetrial
|
|
73
|
+
readonly nativeRetrial = false;
|
|
74
74
|
/**
|
|
75
75
|
* Creates a new SQLite message queue.
|
|
76
76
|
* @param db The SQLite database to use. Supports `node:sqlite`, `bun:sqlite`.
|
|
77
77
|
* @param options The options for the message queue.
|
|
78
78
|
*/
|
|
79
|
-
constructor(db:
|
|
79
|
+
constructor(db: PlatformDatabase, options?: SqliteMessageQueueOptions);
|
|
80
80
|
/**
|
|
81
81
|
* {@inheritDoc MessageQueue.enqueue}
|
|
82
82
|
*/
|
package/dist/mq.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ declare class SqliteMessageQueue implements MessageQueue, Disposable {
|
|
|
71
71
|
/**
|
|
72
72
|
* SQLite message queue does not provide native retry mechanisms.
|
|
73
73
|
*/
|
|
74
|
-
readonly nativeRetrial
|
|
74
|
+
readonly nativeRetrial = false;
|
|
75
75
|
/**
|
|
76
76
|
* Creates a new SQLite message queue.
|
|
77
77
|
* @param db The SQLite database to use. Supports `node:sqlite`, `bun:sqlite`.
|
package/dist/mq.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
4
2
|
import { SqliteDatabase } from "#sqlite";
|
|
5
3
|
import { getLogger } from "@logtape/logtape";
|
|
6
|
-
|
|
7
4
|
//#region src/mq.ts
|
|
8
5
|
const logger = getLogger([
|
|
9
6
|
"fedify",
|
|
@@ -312,10 +309,8 @@ var SqliteMessageQueue = class SqliteMessageQueue {
|
|
|
312
309
|
#isBusyError(error) {
|
|
313
310
|
if (!(error instanceof Error)) return false;
|
|
314
311
|
if (error.message.includes("SQLITE_BUSY") || error.message.includes("database is locked") || error.message.includes("transaction within a transaction")) return true;
|
|
315
|
-
|
|
316
|
-
if (
|
|
317
|
-
const errorWithErrno = error;
|
|
318
|
-
if (errorWithErrno.errno === 5) return true;
|
|
312
|
+
if (error.code === "SQLITE_BUSY") return true;
|
|
313
|
+
if (error.errno === 5) return true;
|
|
319
314
|
return false;
|
|
320
315
|
}
|
|
321
316
|
/**
|
|
@@ -387,6 +382,5 @@ var SqliteMessageQueue = class SqliteMessageQueue {
|
|
|
387
382
|
return JSON.parse(message);
|
|
388
383
|
}
|
|
389
384
|
};
|
|
390
|
-
|
|
391
385
|
//#endregion
|
|
392
|
-
export { SqliteMessageQueue };
|
|
386
|
+
export { SqliteMessageQueue };
|
package/dist/sqlite.bun.cjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
5
|
-
const bun_sqlite = require_rolldown_runtime.__toESM(require("bun:sqlite"));
|
|
6
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
let bun_sqlite = require("bun:sqlite");
|
|
7
4
|
//#region src/sqlite.bun.ts
|
|
8
5
|
var SqliteDatabase = class {
|
|
9
6
|
constructor(db) {
|
|
@@ -28,15 +25,14 @@ var SqliteStatement = class {
|
|
|
28
25
|
}
|
|
29
26
|
get(...params) {
|
|
30
27
|
const result = this.stmt.get(...params);
|
|
31
|
-
if (result === null) return
|
|
28
|
+
if (result === null) return;
|
|
32
29
|
return result;
|
|
33
30
|
}
|
|
34
31
|
all(...params) {
|
|
35
32
|
return this.stmt.all(...params);
|
|
36
33
|
}
|
|
37
34
|
};
|
|
38
|
-
|
|
39
35
|
//#endregion
|
|
40
36
|
exports.PlatformDatabase = bun_sqlite.Database;
|
|
41
37
|
exports.SqliteDatabase = SqliteDatabase;
|
|
42
|
-
exports.SqliteStatement = SqliteStatement;
|
|
38
|
+
exports.SqliteStatement = SqliteStatement;
|
package/dist/sqlite.bun.d.cts
CHANGED
|
@@ -20,4 +20,4 @@ declare class SqliteStatement implements SqliteStatementAdapter {
|
|
|
20
20
|
all(...params: unknown[]): unknown[];
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
export { Database as PlatformDatabase, Statement as PlatformStatement, SqliteDatabase, SqliteStatement };
|
|
23
|
+
export { Database as PlatformDatabase, type Statement as PlatformStatement, SqliteDatabase, SqliteStatement };
|
package/dist/sqlite.bun.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ declare class SqliteStatement implements SqliteStatementAdapter {
|
|
|
21
21
|
all(...params: unknown[]): unknown[];
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
-
export { Database as PlatformDatabase, Statement as PlatformStatement, SqliteDatabase, SqliteStatement };
|
|
24
|
+
export { Database as PlatformDatabase, type Statement as PlatformStatement, SqliteDatabase, SqliteStatement };
|
package/dist/sqlite.bun.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
4
2
|
import { Database } from "bun:sqlite";
|
|
5
|
-
|
|
6
3
|
//#region src/sqlite.bun.ts
|
|
7
4
|
var SqliteDatabase = class {
|
|
8
5
|
constructor(db) {
|
|
@@ -27,13 +24,12 @@ var SqliteStatement = class {
|
|
|
27
24
|
}
|
|
28
25
|
get(...params) {
|
|
29
26
|
const result = this.stmt.get(...params);
|
|
30
|
-
if (result === null) return
|
|
27
|
+
if (result === null) return;
|
|
31
28
|
return result;
|
|
32
29
|
}
|
|
33
30
|
all(...params) {
|
|
34
31
|
return this.stmt.all(...params);
|
|
35
32
|
}
|
|
36
33
|
};
|
|
37
|
-
|
|
38
34
|
//#endregion
|
|
39
|
-
export { Database as PlatformDatabase, SqliteDatabase, SqliteStatement };
|
|
35
|
+
export { Database as PlatformDatabase, SqliteDatabase, SqliteStatement };
|
package/dist/sqlite.node.cjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
5
|
-
const node_sqlite = require_rolldown_runtime.__toESM(require("node:sqlite"));
|
|
6
|
-
|
|
1
|
+
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
let node_sqlite = require("node:sqlite");
|
|
7
4
|
//#region src/sqlite.node.ts
|
|
8
5
|
var SqliteDatabase = class {
|
|
9
6
|
constructor(db) {
|
|
@@ -37,8 +34,7 @@ var SqliteStatement = class {
|
|
|
37
34
|
return this.stmt.all(...params);
|
|
38
35
|
}
|
|
39
36
|
};
|
|
40
|
-
|
|
41
37
|
//#endregion
|
|
42
38
|
exports.PlatformDatabase = node_sqlite.DatabaseSync;
|
|
43
39
|
exports.SqliteDatabase = SqliteDatabase;
|
|
44
|
-
exports.SqliteStatement = SqliteStatement;
|
|
40
|
+
exports.SqliteStatement = SqliteStatement;
|
package/dist/sqlite.node.d.cts
CHANGED
|
@@ -20,4 +20,4 @@ declare class SqliteStatement implements SqliteStatementAdapter {
|
|
|
20
20
|
all(...params: unknown[]): unknown[];
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
export { DatabaseSync as PlatformDatabase, StatementSync as PlatformStatement, SqliteDatabase, SqliteStatement };
|
|
23
|
+
export { DatabaseSync as PlatformDatabase, type StatementSync as PlatformStatement, SqliteDatabase, SqliteStatement };
|
package/dist/sqlite.node.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ declare class SqliteStatement implements SqliteStatementAdapter {
|
|
|
21
21
|
all(...params: unknown[]): unknown[];
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
-
export { DatabaseSync as PlatformDatabase, StatementSync as PlatformStatement, SqliteDatabase, SqliteStatement };
|
|
24
|
+
export { DatabaseSync as PlatformDatabase, type StatementSync as PlatformStatement, SqliteDatabase, SqliteStatement };
|
package/dist/sqlite.node.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
3
|
-
|
|
1
|
+
import "@js-temporal/polyfill";
|
|
4
2
|
import { DatabaseSync } from "node:sqlite";
|
|
5
|
-
|
|
6
3
|
//#region src/sqlite.node.ts
|
|
7
4
|
var SqliteDatabase = class {
|
|
8
5
|
constructor(db) {
|
|
@@ -36,6 +33,5 @@ var SqliteStatement = class {
|
|
|
36
33
|
return this.stmt.all(...params);
|
|
37
34
|
}
|
|
38
35
|
};
|
|
39
|
-
|
|
40
36
|
//#endregion
|
|
41
|
-
export { DatabaseSync as PlatformDatabase, SqliteDatabase, SqliteStatement };
|
|
37
|
+
export { DatabaseSync as PlatformDatabase, SqliteDatabase, SqliteStatement };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/sqlite",
|
|
3
|
-
"version": "2.2.0-dev.
|
|
3
|
+
"version": "2.2.0-dev.622+e54cb037",
|
|
4
4
|
"description": "SQLite drivers for Fedify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fedify",
|
|
@@ -72,13 +72,13 @@
|
|
|
72
72
|
"es-toolkit": "^1.31.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@fedify/fedify": "^2.2.0-dev.
|
|
75
|
+
"@fedify/fedify": "^2.2.0-dev.622+e54cb037"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@std/async": "npm:@jsr/std__async@^1.0.13",
|
|
79
|
-
"tsdown": "^0.
|
|
80
|
-
"typescript": "^5.9.
|
|
81
|
-
"@fedify/testing": "^2.2.0-dev.
|
|
79
|
+
"tsdown": "^0.21.6",
|
|
80
|
+
"typescript": "^5.9.2",
|
|
81
|
+
"@fedify/testing": "^2.2.0-dev.622+e54cb037"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build:self": "tsdown",
|
package/tsdown.config.ts
CHANGED
|
@@ -12,6 +12,12 @@ export default defineConfig({
|
|
|
12
12
|
unbundle: true,
|
|
13
13
|
format: ["esm", "cjs"],
|
|
14
14
|
platform: "node",
|
|
15
|
+
outExtensions({ format }) {
|
|
16
|
+
return {
|
|
17
|
+
js: format === "cjs" ? ".cjs" : ".js",
|
|
18
|
+
dts: format === "cjs" ? ".d.cts" : ".d.ts",
|
|
19
|
+
};
|
|
20
|
+
},
|
|
15
21
|
inputOptions: {
|
|
16
22
|
onwarn(warning, defaultHandler) {
|
|
17
23
|
if (
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const { Temporal } = require("@js-temporal/polyfill");
|
|
3
|
-
|
|
4
|
-
//#region rolldown:runtime
|
|
5
|
-
var __create = Object.create;
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
value: mod,
|
|
23
|
-
enumerable: true
|
|
24
|
-
}) : target, mod));
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
27
|
-
|
|
28
|
-
Object.defineProperty(exports, '__toESM', {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return __toESM;
|
|
32
|
-
}
|
|
33
|
-
});
|