pluresdb 1.0.1 → 1.3.1
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 +100 -5
- package/dist/.tsbuildinfo +1 -1
- package/dist/better-sqlite3-shared.d.ts +12 -0
- package/dist/better-sqlite3-shared.d.ts.map +1 -0
- package/dist/better-sqlite3-shared.js +143 -0
- package/dist/better-sqlite3-shared.js.map +1 -0
- package/dist/better-sqlite3.d.ts +4 -0
- package/dist/better-sqlite3.d.ts.map +1 -0
- package/dist/better-sqlite3.js +8 -0
- package/dist/better-sqlite3.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +21 -16
- package/dist/cli.js.map +1 -1
- package/dist/node-index.d.ts +98 -2
- package/dist/node-index.d.ts.map +1 -1
- package/dist/node-index.js +312 -6
- package/dist/node-index.js.map +1 -1
- package/dist/node-wrapper.d.ts.map +1 -1
- package/dist/node-wrapper.js +5 -3
- package/dist/node-wrapper.js.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/node-types.d.ts +12 -0
- package/dist/types/node-types.d.ts.map +1 -1
- package/dist/types/node-types.js.map +1 -1
- package/dist/vscode/extension.d.ts.map +1 -1
- package/dist/vscode/extension.js +4 -4
- package/dist/vscode/extension.js.map +1 -1
- package/examples/basic-usage.d.ts +1 -1
- package/examples/vscode-extension-example/src/extension.ts +15 -6
- package/examples/vscode-extension-integration.d.ts +24 -17
- package/examples/vscode-extension-integration.js +140 -106
- package/examples/vscode-extension-integration.ts +1 -1
- package/{src → legacy}/benchmarks/memory-benchmarks.ts +85 -51
- package/{src → legacy}/benchmarks/run-benchmarks.ts +32 -10
- package/legacy/better-sqlite3-shared.ts +157 -0
- package/legacy/better-sqlite3.ts +4 -0
- package/{src → legacy}/cli.ts +14 -4
- package/{src → legacy}/config.ts +2 -1
- package/{src → legacy}/core/crdt.ts +4 -1
- package/{src → legacy}/core/database.ts +57 -22
- package/{src → legacy}/healthcheck.ts +11 -5
- package/{src → legacy}/http/api-server.ts +125 -21
- package/{src → legacy}/index.ts +2 -2
- package/{src → legacy}/logic/rules.ts +3 -1
- package/{src → legacy}/main.ts +11 -4
- package/legacy/node-index.ts +823 -0
- package/{src → legacy}/node-wrapper.ts +18 -9
- package/{src → legacy}/sqlite-compat.ts +63 -16
- package/{src → legacy}/sqlite3-compat.ts +2 -2
- package/{src → legacy}/storage/kv-storage.ts +3 -1
- package/{src → legacy}/tests/core.test.ts +37 -13
- package/{src → legacy}/tests/fixtures/test-data.json +6 -1
- package/{src → legacy}/tests/integration/api-server.test.ts +110 -8
- package/{src → legacy}/tests/integration/mesh-network.test.ts +8 -2
- package/{src → legacy}/tests/logic.test.ts +6 -2
- package/{src → legacy}/tests/performance/load.test.ts +4 -2
- package/{src → legacy}/tests/security/input-validation.test.ts +5 -1
- package/{src → legacy}/tests/unit/core.test.ts +13 -3
- package/{src → legacy}/tests/unit/subscriptions.test.ts +1 -1
- package/{src → legacy}/tests/vscode_extension_test.ts +39 -11
- package/{src → legacy}/types/node-types.ts +14 -0
- package/{src → legacy}/vscode/extension.ts +37 -14
- package/package.json +19 -9
- package/scripts/compiled-crud-verify.ts +3 -1
- package/scripts/dogfood.ts +55 -16
- package/scripts/postinstall.js +4 -3
- package/scripts/release-check.js +190 -0
- package/scripts/run-tests.ts +5 -2
- package/scripts/update-changelog.js +214 -0
- package/web/svelte/package.json +5 -5
- package/src/node-index.ts +0 -385
- /package/{src → legacy}/main.rs +0 -0
- /package/{src → legacy}/network/websocket-server.ts +0 -0
- /package/{src → legacy}/tests/fixtures/performance-data.json +0 -0
- /package/{src → legacy}/tests/unit/vector-search.test.ts +0 -0
- /package/{src → legacy}/types/index.ts +0 -0
- /package/{src → legacy}/util/debug.ts +0 -0
- /package/{src → legacy}/vector/index.ts +0 -0
|
@@ -3,7 +3,9 @@ import type { NodeRecord } from "../types/index.ts";
|
|
|
3
3
|
// Minimal DB interface to avoid circular imports
|
|
4
4
|
export interface DatabaseLike {
|
|
5
5
|
put(id: string, data: Record<string, unknown>): Promise<void>;
|
|
6
|
-
get<T = Record<string, unknown>>(
|
|
6
|
+
get<T = Record<string, unknown>>(
|
|
7
|
+
id: string,
|
|
8
|
+
): Promise<(T & { id: string }) | null>;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export interface RuleContext {
|
package/{src → legacy}/main.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GunDB } from "./core/database.ts";
|
|
2
|
-
import { debugLog } from "./util/debug.ts";
|
|
2
|
+
import { debugLog as _debugLog } from "./util/debug.ts";
|
|
3
3
|
import { startApiServer } from "./http/api-server.ts";
|
|
4
4
|
import { loadConfig, saveConfig } from "./config.ts";
|
|
5
5
|
|
|
@@ -118,7 +118,9 @@ if (import.meta.main) {
|
|
|
118
118
|
const db = new GunDB();
|
|
119
119
|
await db.ready(kvPath);
|
|
120
120
|
const results = await db.vectorSearch(query, k);
|
|
121
|
-
console.log(
|
|
121
|
+
console.log(
|
|
122
|
+
JSON.stringify(results.map((n) => ({ id: n.id, data: n.data }))),
|
|
123
|
+
);
|
|
122
124
|
await db.close();
|
|
123
125
|
break;
|
|
124
126
|
}
|
|
@@ -150,7 +152,9 @@ if (import.meta.main) {
|
|
|
150
152
|
const db = new GunDB();
|
|
151
153
|
await db.ready(kvPath);
|
|
152
154
|
const rows = await db.instancesOf(typeName);
|
|
153
|
-
console.log(
|
|
155
|
+
console.log(
|
|
156
|
+
JSON.stringify(rows.map((n) => ({ id: n.id, data: n.data }))),
|
|
157
|
+
);
|
|
154
158
|
await db.close();
|
|
155
159
|
break;
|
|
156
160
|
}
|
|
@@ -162,7 +166,10 @@ if (import.meta.main) {
|
|
|
162
166
|
const db = new GunDB();
|
|
163
167
|
await db.ready(kvPath);
|
|
164
168
|
const nodes = await db.getAll();
|
|
165
|
-
const out = nodes.map((node) => ({
|
|
169
|
+
const out = nodes.map((node) => ({
|
|
170
|
+
id: node.id,
|
|
171
|
+
data: node.data as Record<string, unknown>,
|
|
172
|
+
}));
|
|
166
173
|
console.log(JSON.stringify(out));
|
|
167
174
|
await db.close();
|
|
168
175
|
break;
|