@yydb/yydb-unknown-wasm32 0.0.5 → 0.0.7
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/package.json +22 -22
- package/src/index.ts +0 -13
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
2
|
+
"bugs": {
|
|
3
|
+
"url": "https://github.com/yy-database/yydb/issues"
|
|
4
|
+
},
|
|
4
5
|
"description": "Browser WebAssembly binary for `@yydb/yydb`",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
],
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@types/node": "^20.10.0",
|
|
8
|
+
"typescript": "~5.3.0"
|
|
9
|
+
},
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"
|
|
12
|
+
"default": "./src/index.ts",
|
|
13
13
|
"import": "./src/index.ts",
|
|
14
|
-
"
|
|
14
|
+
"types": "./src/index.ts"
|
|
15
15
|
},
|
|
16
16
|
"./wasm": "./lib/yydb_wasm_bg.wasm"
|
|
17
17
|
},
|
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
"lib",
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
"homepage": "https://github.com/yy-database/yydb/tree/dev/projects/packages/yydb-unknown-wasm32#readme",
|
|
24
|
+
"license": "MPL-2.0",
|
|
25
|
+
"name": "@yydb/yydb-unknown-wasm32",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
26
28
|
},
|
|
27
29
|
"repository": {
|
|
28
30
|
"type": "git",
|
|
29
31
|
"url": "git+https://github.com/yy-database/yydb.git",
|
|
30
32
|
"directory": "projects/packages/yydb-unknown-wasm32"
|
|
31
33
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
34
|
+
"scripts": {
|
|
35
|
+
"test": "pnpm run typecheck",
|
|
36
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
38
37
|
},
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
"sideEffects": [
|
|
39
|
+
"./lib/yydb_wasm.js"
|
|
40
|
+
],
|
|
41
|
+
"type": "module",
|
|
42
|
+
"version": "0.0.7"
|
|
43
43
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,6 @@ export type CheckSchemaResult = {
|
|
|
11
11
|
ok: boolean;
|
|
12
12
|
tableCount: number;
|
|
13
13
|
schemaFingerprint: string;
|
|
14
|
-
engineVersion: string;
|
|
15
14
|
error?: string;
|
|
16
15
|
};
|
|
17
16
|
|
|
@@ -25,8 +24,6 @@ export type MicroHostInvokePayload = {
|
|
|
25
24
|
/** Stateful wasm session (memory or OPFS-backed). */
|
|
26
25
|
export type WasmSession = {
|
|
27
26
|
ensureSchema(document: string): string;
|
|
28
|
-
query(source: string): string;
|
|
29
|
-
execute(source: string): string;
|
|
30
27
|
get(key: string): string;
|
|
31
28
|
put(key: string, value: Uint8Array): string;
|
|
32
29
|
getSchema(): string;
|
|
@@ -42,7 +39,6 @@ const glueApi = glue as {
|
|
|
42
39
|
yydbVersion?: () => string;
|
|
43
40
|
checkSchema?: (source: string) => CheckSchemaResult;
|
|
44
41
|
introspectSchema?: (source: string) => string;
|
|
45
|
-
queryMemory?: (source: string) => string;
|
|
46
42
|
MemorySession?: new () => WasmSession;
|
|
47
43
|
PersistentSession?: new (path: string) => WasmSession;
|
|
48
44
|
};
|
|
@@ -119,15 +115,6 @@ export function introspectSchema(source: string): string {
|
|
|
119
115
|
return glueApi.introspectSchema(source);
|
|
120
116
|
}
|
|
121
117
|
|
|
122
|
-
/** Execute a VOS query on a fresh in-memory database. Returns JSON `{ ok, rows, error }`. */
|
|
123
|
-
export function queryMemory(source: string): string {
|
|
124
|
-
assertReady();
|
|
125
|
-
if (!glueApi.queryMemory) {
|
|
126
|
-
throw new Error('@yydb/yydb-unknown-wasm32: queryMemory export missing, rebuild wasm artifacts');
|
|
127
|
-
}
|
|
128
|
-
return glueApi.queryMemory(source);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
118
|
/** Open a stateful in-memory session. */
|
|
132
119
|
export function createMemorySession(): WasmSession {
|
|
133
120
|
assertReady();
|