@grafeo-db/wasm-lite 0.5.15
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/grafeo_wasm.d.ts +133 -0
- package/grafeo_wasm.js +9 -0
- package/grafeo_wasm_bg.wasm +0 -0
- package/grafeo_wasm_bg.wasm.d.ts +22 -0
- package/package.json +37 -0
package/grafeo_wasm.d.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A Grafeo graph database instance running in WebAssembly.
|
|
6
|
+
*
|
|
7
|
+
* All data is held in memory within the WASM heap. For persistence,
|
|
8
|
+
* use `exportSnapshot()` / `importSnapshot()` with IndexedDB or
|
|
9
|
+
* the higher-level `@grafeo-db/web` package.
|
|
10
|
+
*/
|
|
11
|
+
export class Database {
|
|
12
|
+
free(): void;
|
|
13
|
+
[Symbol.dispose](): void;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the number of edges in the database.
|
|
16
|
+
*/
|
|
17
|
+
edgeCount(): number;
|
|
18
|
+
/**
|
|
19
|
+
* Executes a GQL query and returns results as an array of objects.
|
|
20
|
+
*
|
|
21
|
+
* Each row becomes a JavaScript object with column names as keys.
|
|
22
|
+
*
|
|
23
|
+
* ```js
|
|
24
|
+
* const results = db.execute("MATCH (p:Person) RETURN p.name, p.age");
|
|
25
|
+
* // [{name: "Alix", age: 30}, {name: "Gus", age: 25}]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
execute(query: string): any;
|
|
29
|
+
/**
|
|
30
|
+
* Executes a GQL query and returns raw columns, rows, and metadata.
|
|
31
|
+
*
|
|
32
|
+
* Returns `{ columns: string[], rows: any[][], executionTimeMs?: number }`.
|
|
33
|
+
*/
|
|
34
|
+
executeRaw(query: string): any;
|
|
35
|
+
/**
|
|
36
|
+
* Executes a query in a specific language and returns raw columns, rows, and metadata.
|
|
37
|
+
*
|
|
38
|
+
* Returns `{ columns: string[], rows: any[][], executionTimeMs?: number }`.
|
|
39
|
+
*
|
|
40
|
+
* ```js
|
|
41
|
+
* const raw = db.executeRawWithLanguage("MATCH (p:Person) RETURN p.name", "cypher");
|
|
42
|
+
* // { columns: ["p.name"], rows: [["Alix"], ["Gus"]], executionTimeMs: 0.5 }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
executeRawWithLanguage(query: string, language: string): any;
|
|
46
|
+
/**
|
|
47
|
+
* Executes a query using a specific query language.
|
|
48
|
+
*
|
|
49
|
+
* Supported languages: `"gql"`, `"cypher"`, `"sparql"`, `"gremlin"`, `"graphql"`, `"sql"`.
|
|
50
|
+
* Languages require their corresponding feature flag to be enabled.
|
|
51
|
+
*
|
|
52
|
+
* ```js
|
|
53
|
+
* const results = db.executeWithLanguage(
|
|
54
|
+
* "MATCH (p:Person) RETURN p.name",
|
|
55
|
+
* "cypher"
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
executeWithLanguage(query: string, language: string): any;
|
|
60
|
+
/**
|
|
61
|
+
* Executes a query using a specific language with parameters.
|
|
62
|
+
*
|
|
63
|
+
* Combines language selection with parameterised queries.
|
|
64
|
+
*
|
|
65
|
+
* ```js
|
|
66
|
+
* const results = db.executeWithLanguageAndParams(
|
|
67
|
+
* "MATCH (p:Person {name: $name}) RETURN p.name",
|
|
68
|
+
* "cypher",
|
|
69
|
+
* { name: "Alix" }
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
executeWithLanguageAndParams(query: string, language: string, params: any): any;
|
|
74
|
+
/**
|
|
75
|
+
* Executes a GQL query with parameters and returns results as an array of objects.
|
|
76
|
+
*
|
|
77
|
+
* Parameters are passed as a JavaScript object with string keys.
|
|
78
|
+
* Use `$name` syntax in the query to reference parameters.
|
|
79
|
+
*
|
|
80
|
+
* ```js
|
|
81
|
+
* const results = db.executeWithParams(
|
|
82
|
+
* "MATCH (p:Person {name: $name}) RETURN p.name, p.age",
|
|
83
|
+
* { name: "Alix" }
|
|
84
|
+
* );
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
executeWithParams(query: string, params: any): any;
|
|
88
|
+
/**
|
|
89
|
+
* Exports the database to a binary snapshot.
|
|
90
|
+
*
|
|
91
|
+
* Returns a `Uint8Array` that can be stored in IndexedDB, localStorage,
|
|
92
|
+
* or sent over the network. Restore with `Database.importSnapshot()`.
|
|
93
|
+
*
|
|
94
|
+
* ```js
|
|
95
|
+
* const bytes = db.exportSnapshot();
|
|
96
|
+
* // Store in IndexedDB, download as file, etc.
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
exportSnapshot(): Uint8Array;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a database from a binary snapshot.
|
|
102
|
+
*
|
|
103
|
+
* The `data` must have been produced by `exportSnapshot()`.
|
|
104
|
+
*
|
|
105
|
+
* ```js
|
|
106
|
+
* const db = Database.importSnapshot(bytes);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
static importSnapshot(data: Uint8Array): Database;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a new in-memory database.
|
|
112
|
+
*/
|
|
113
|
+
constructor();
|
|
114
|
+
/**
|
|
115
|
+
* Returns the number of nodes in the database.
|
|
116
|
+
*/
|
|
117
|
+
nodeCount(): number;
|
|
118
|
+
/**
|
|
119
|
+
* Returns schema information about the database.
|
|
120
|
+
*
|
|
121
|
+
* Returns an object describing labels, edge types, and property keys.
|
|
122
|
+
*
|
|
123
|
+
* ```js
|
|
124
|
+
* const schema = db.schema();
|
|
125
|
+
* // { lpg: { labels: [...], edgeTypes: [...], propertyKeys: [...] } }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
schema(): any;
|
|
129
|
+
/**
|
|
130
|
+
* Returns the Grafeo version.
|
|
131
|
+
*/
|
|
132
|
+
static version(): string;
|
|
133
|
+
}
|
package/grafeo_wasm.js
ADDED
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_database_free: (a: number, b: number) => void;
|
|
5
|
+
export const database_edgeCount: (a: number) => number;
|
|
6
|
+
export const database_execute: (a: number, b: number, c: number, d: number) => void;
|
|
7
|
+
export const database_executeRaw: (a: number, b: number, c: number, d: number) => void;
|
|
8
|
+
export const database_executeRawWithLanguage: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const database_executeWithLanguage: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
10
|
+
export const database_executeWithLanguageAndParams: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
11
|
+
export const database_executeWithParams: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
12
|
+
export const database_exportSnapshot: (a: number, b: number) => void;
|
|
13
|
+
export const database_importSnapshot: (a: number, b: number, c: number) => void;
|
|
14
|
+
export const database_new: (a: number) => void;
|
|
15
|
+
export const database_nodeCount: (a: number) => number;
|
|
16
|
+
export const database_schema: (a: number, b: number) => void;
|
|
17
|
+
export const database_version: (a: number) => void;
|
|
18
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
19
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
20
|
+
export const __wbindgen_export3: (a: number) => void;
|
|
21
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
22
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grafeo-db/wasm-lite",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.5.15",
|
|
5
|
+
"description": "WebAssembly bindings for Grafeo - GQL-only lightweight variant",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"graph",
|
|
8
|
+
"database",
|
|
9
|
+
"gql",
|
|
10
|
+
"knowledge-graph",
|
|
11
|
+
"wasm",
|
|
12
|
+
"webassembly"
|
|
13
|
+
],
|
|
14
|
+
"author": "S.T. Grond",
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/GrafeoDB/grafeo.git",
|
|
19
|
+
"directory": "crates/bindings/wasm"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://grafeo.dev",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/GrafeoDB/grafeo/issues"
|
|
24
|
+
},
|
|
25
|
+
"main": "grafeo_wasm.js",
|
|
26
|
+
"types": "grafeo_wasm.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"grafeo_wasm.js",
|
|
29
|
+
"grafeo_wasm.d.ts",
|
|
30
|
+
"grafeo_wasm_bg.wasm",
|
|
31
|
+
"grafeo_wasm_bg.wasm.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"./grafeo_wasm.js",
|
|
35
|
+
"./snippets/*"
|
|
36
|
+
]
|
|
37
|
+
}
|