@yydb/yydb-unknown-wasm32 0.0.0 → 0.0.6

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.
Files changed (3) hide show
  1. package/README.md +27 -27
  2. package/package.json +5 -5
  3. package/src/index.ts +0 -13
package/README.md CHANGED
@@ -1,27 +1,27 @@
1
- # `@yydb/yydb-unknown-wasm32`
2
-
3
- Low-level wasm-pack artifacts for the YYDB browser core. **App authors should use
4
- [`@yydb/yydb/wasm`](https://www.npmjs.com/package/@yydb/yydb)** instead of this package.
5
-
6
- Import here only when you need the raw glue or bundled `.wasm` path. For durable reads and writes in production, prefer
7
- [`@yydb/yydb-client`](https://www.npmjs.com/package/@yydb/yydb-client) against `yydb serve` until wasm persistence
8
- lands.
9
-
10
- ## Example
11
-
12
- ```ts
13
- import {initWasm, checkSchema, yydbVersion} from "@yydb/yydb/wasm";
14
-
15
- await initWasm();
16
-
17
- console.log(yydbVersion());
18
- console.log(
19
- checkSchema("table Setting { @@id: uuid, key: utf8 }"),
20
- );
21
- ```
22
-
23
- Call `initWasm()` once before semantic methods. Omit `options.module` to load the bundled `lib/yydb_wasm_bg.wasm` asset.
24
-
25
- Low-level glue: `@yydb/yydb-unknown-wasm32/wasm` (raw `.wasm` path).
26
-
27
- [YYDB overview](https://github.com/yy-database/yydb.rs)
1
+ # `@yydb/yydb-unknown-wasm32`
2
+
3
+ Low-level wasm-pack artifacts for the YYDB browser core. **App authors should use
4
+ [`@yydb/yydb/wasm`](https://www.npmjs.com/package/@yydb/yydb)** instead of this package.
5
+
6
+ Import here only when you need the raw glue or bundled `.wasm` path. For durable reads and writes in production, prefer
7
+ [`@yydb/yydb-client`](https://www.npmjs.com/package/@yydb/yydb-client) against `yydb serve` until wasm persistence
8
+ lands.
9
+
10
+ ## Example
11
+
12
+ ```ts
13
+ import {initWasm, checkSchema, yydbVersion} from "@yydb/yydb/wasm";
14
+
15
+ await initWasm();
16
+
17
+ console.log(yydbVersion());
18
+ console.log(
19
+ checkSchema("table Setting { @@id: uuid, key: utf8 }"),
20
+ );
21
+ ```
22
+
23
+ Call `initWasm()` once before semantic methods. Omit `options.module` to load the bundled `lib/yydb_wasm_bg.wasm` asset.
24
+
25
+ Low-level glue: `@yydb/yydb-unknown-wasm32/wasm` (raw `.wasm` path).
26
+
27
+ [YYDB overview](https://github.com/yy-database/yydb.rs)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "bugs": {
3
- "url": "https://github.com/yy-database/yydb.rs/issues"
3
+ "url": "https://github.com/yy-database/yydb/issues"
4
4
  },
5
5
  "description": "Browser WebAssembly binary for `@yydb/yydb`",
6
6
  "devDependencies": {
@@ -20,16 +20,16 @@
20
20
  "lib",
21
21
  "README.md"
22
22
  ],
23
- "homepage": "https://github.com/yy-database/yydb.rs/tree/dev/projects/packages/yydb-unknown-wasm32#readme",
23
+ "homepage": "https://github.com/yy-database/yydb/tree/dev/projects/packages/yydb-unknown-wasm32#readme",
24
24
  "license": "MPL-2.0",
25
25
  "name": "@yydb/yydb-unknown-wasm32",
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
29
  "repository": {
30
- "directory": "projects/packages/yydb-unknown-wasm32",
31
30
  "type": "git",
32
- "url": "git+https://github.com/yy-database/yydb.rs.git"
31
+ "url": "git+https://github.com/yy-database/yydb.git",
32
+ "directory": "projects/packages/yydb-unknown-wasm32"
33
33
  },
34
34
  "scripts": {
35
35
  "test": "pnpm run typecheck",
@@ -39,5 +39,5 @@
39
39
  "./lib/yydb_wasm.js"
40
40
  ],
41
41
  "type": "module",
42
- "version": "0.0.0"
42
+ "version": "0.0.6"
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();