@yydb/yyds 0.0.12 → 0.0.13
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 +6 -6
- package/src/node/index.ts +1 -11
- package/src/node/load.ts +0 -20
- package/src/node/sqlite-bindings.ts +0 -70
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yydb/yyds",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Node.js facade, CLI, and native bindings for local YYDS nodes.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"bin": {
|
|
31
|
-
"yyds": "
|
|
31
|
+
"yyds": "bin/yyds.mjs"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"bin",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"@yydb/yyds-win32-x64": "0.0.
|
|
61
|
-
"@yydb/yyds-linux-x64": "0.0.
|
|
62
|
-
"@yydb/yyds-darwin-x64": "0.0.
|
|
63
|
-
"@yydb/yyds-darwin-arm64": "0.0.
|
|
60
|
+
"@yydb/yyds-win32-x64": "0.0.13",
|
|
61
|
+
"@yydb/yyds-linux-x64": "0.0.13",
|
|
62
|
+
"@yydb/yyds-darwin-x64": "0.0.13",
|
|
63
|
+
"@yydb/yyds-darwin-arm64": "0.0.13"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^22.15.0",
|
package/src/node/index.ts
CHANGED
|
@@ -7,16 +7,6 @@
|
|
|
7
7
|
export type { YydsBindings, NodeStatusBinding, ServiceBinding } from "../bindings.ts";
|
|
8
8
|
export type { YydsProtocol } from "./cluster.ts";
|
|
9
9
|
export { launchYydsServer, yydsStartArguments } from "./cluster.ts";
|
|
10
|
-
export { isYydsNativeInstalled, loadYydsNative
|
|
10
|
+
export { isYydsNativeInstalled, loadYydsNative } from "./load.ts";
|
|
11
11
|
export type { StartNodeOptions } from "./runtime.ts";
|
|
12
12
|
export { parseStartOptions, runNodeStart } from "./runtime.ts";
|
|
13
|
-
export type {
|
|
14
|
-
SqliteDatabaseBinding,
|
|
15
|
-
SqliteDecodedRow,
|
|
16
|
-
SqliteReadLimits,
|
|
17
|
-
SqliteRecordValue,
|
|
18
|
-
SqliteSchemaObject,
|
|
19
|
-
SqliteSnapshotBinding,
|
|
20
|
-
SqliteTableRow,
|
|
21
|
-
YydsSqliteBindings,
|
|
22
|
-
} from "./sqlite-bindings.ts";
|
package/src/node/load.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
|
|
3
3
|
import type { YydsBindings } from "../bindings.ts";
|
|
4
4
|
import { resolvePlatformPackage } from "./platform-packages.ts";
|
|
5
|
-
import type { YydsSqliteBindings } from "./sqlite-bindings.ts";
|
|
6
5
|
|
|
7
6
|
const require = createRequire(import.meta.url);
|
|
8
7
|
|
|
@@ -17,25 +16,6 @@ export function loadYydsNative(): YydsBindings {
|
|
|
17
16
|
return binding as unknown as YydsBindings;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
/** Load the independent SQLite snapshot reader, not a YYDS execution session. */
|
|
21
|
-
export function loadYydsSqliteNative(): YydsSqliteBindings {
|
|
22
|
-
const binding = bindingModule();
|
|
23
|
-
if (typeof binding.SqliteSnapshot !== "function") {
|
|
24
|
-
throw new Error("Native addon lacks the SQLite snapshot reader. Rebuild the native package.");
|
|
25
|
-
}
|
|
26
|
-
if (typeof binding.SqliteDatabase !== "function") {
|
|
27
|
-
throw new Error("Native addon lacks the SqliteDatabase class. Rebuild the native package.");
|
|
28
|
-
}
|
|
29
|
-
if (typeof binding.decodeRecord !== "function") {
|
|
30
|
-
throw new Error("Native addon lacks decodeRecord. Rebuild the native package.");
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
SqliteSnapshot: binding.SqliteSnapshot as YydsSqliteBindings["SqliteSnapshot"],
|
|
34
|
-
SqliteDatabase: binding.SqliteDatabase as unknown as YydsSqliteBindings["SqliteDatabase"],
|
|
35
|
-
decodeRecord: binding.decodeRecord as YydsSqliteBindings["decodeRecord"],
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
19
|
/** Whether the current platform optional dependency is installed. */
|
|
40
20
|
export function isYydsNativeInstalled(): boolean {
|
|
41
21
|
try {
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/** Bounds apply independently to each schema or table scan. */
|
|
2
|
-
export interface SqliteReadLimits {
|
|
3
|
-
maxPages?: number;
|
|
4
|
-
maxRows?: number;
|
|
5
|
-
maxPayloadBytes?: number;
|
|
6
|
-
maxTotalPayloadBytes?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** SQL source is opaque. No CREATE statement is parsed or executed. */
|
|
10
|
-
export interface SqliteSchemaObject {
|
|
11
|
-
kind: "table" | "index" | "view" | "trigger";
|
|
12
|
-
name: string;
|
|
13
|
-
tableName: string;
|
|
14
|
-
rootPage?: number;
|
|
15
|
-
sql?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Raw storage values, not SQL results or INTEGER PRIMARY KEY expansion. */
|
|
19
|
-
export interface SqliteTableRow {
|
|
20
|
-
rowid: bigint;
|
|
21
|
-
payload: Buffer;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** One decoded SQLite storage-class field. Exactly one `value*` is populated. */
|
|
25
|
-
export interface SqliteRecordValue {
|
|
26
|
-
kind: "null" | "integer" | "real" | "text" | "blob";
|
|
27
|
-
valueInteger?: bigint;
|
|
28
|
-
valueReal?: number;
|
|
29
|
-
valueText?: string;
|
|
30
|
-
valueBlob?: Buffer;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** A decoded SQLite row with storage-class typed columns. */
|
|
34
|
-
export interface SqliteDecodedRow {
|
|
35
|
-
rowid: bigint;
|
|
36
|
-
columns: SqliteRecordValue[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Binding surface for SqliteSnapshot (read-only main-file buffer). */
|
|
40
|
-
export interface SqliteSnapshotBinding {
|
|
41
|
-
schema(limits?: SqliteReadLimits): SqliteSchemaObject[];
|
|
42
|
-
table(name: string, limits?: SqliteReadLimits): SqliteTableRow[];
|
|
43
|
-
tableDecoded(name: string, limits?: SqliteReadLimits): SqliteDecodedRow[];
|
|
44
|
-
sqliteVersion(): string;
|
|
45
|
-
encoding(): string;
|
|
46
|
-
ping(): number;
|
|
47
|
-
pages(): Buffer;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** Binding surface for SqliteDatabase (file-backed or in-memory handle). */
|
|
51
|
-
export interface SqliteDatabaseBinding {
|
|
52
|
-
path(): string | null;
|
|
53
|
-
ping(): number;
|
|
54
|
-
sqliteVersion(): string;
|
|
55
|
-
encoding(): string;
|
|
56
|
-
schema(limits?: SqliteReadLimits): SqliteSchemaObject[];
|
|
57
|
-
table(name: string, limits?: SqliteReadLimits): SqliteDecodedRow[];
|
|
58
|
-
tableRaw(name: string, limits?: SqliteReadLimits): SqliteTableRow[];
|
|
59
|
-
pages(): Buffer;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** Combined SQLite native addon surface. */
|
|
63
|
-
export interface YydsSqliteBindings {
|
|
64
|
-
SqliteSnapshot: new (bytes: Buffer, maxSnapshotBytes?: number) => SqliteSnapshotBinding;
|
|
65
|
-
SqliteDatabase: {
|
|
66
|
-
openInMemory(): SqliteDatabaseBinding;
|
|
67
|
-
open(path: string): SqliteDatabaseBinding;
|
|
68
|
-
};
|
|
69
|
-
decodeRecord(payload: Buffer, encoding?: string): SqliteRecordValue[];
|
|
70
|
-
}
|