@hpcc-js/wasm-duckdb 1.12.0 → 1.13.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.
@@ -0,0 +1,170 @@
1
+ // TypeScript bindings for emscripten-generated code. Automatically generated at compile time.
2
+ declare namespace RuntimeExports {
3
+ /**
4
+ * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
5
+ * emscripten HEAP, returns a copy of that string as a Javascript String object.
6
+ *
7
+ * @param {number} ptr
8
+ * @param {number=} maxBytesToRead - An optional length that specifies the
9
+ * maximum number of bytes to read. You can omit this parameter to scan the
10
+ * string until the first 0 byte. If maxBytesToRead is passed, and the string
11
+ * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
12
+ * string will cut short at that byte index.
13
+ * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
14
+ * @return {string}
15
+ */
16
+ function UTF8ToString(ptr: number, maxBytesToRead?: number | undefined, ignoreNul?: boolean | undefined): string;
17
+ function lengthBytesUTF8(str: any): number;
18
+ function stringToUTF8(str: any, outPtr: any, maxBytesToWrite: any): any;
19
+ let HEAPU8: any;
20
+ let FS_createPath: any;
21
+ function FS_createDataFile(parent: any, name: any, fileData: any, canRead: any, canWrite: any, canOwn: any): void;
22
+ function FS_preloadFile(parent: any, name: any, url: any, canRead: any, canWrite: any, dontCreateFile: any, canOwn: any, preFinish: any): Promise<void>;
23
+ function FS_unlink(path: any): any;
24
+ function addRunDependency(id: any): void;
25
+ function removeRunDependency(id: any): void;
26
+ }
27
+ interface WasmModule {
28
+ _malloc(_0: number): number;
29
+ _free(_0: number): void;
30
+ }
31
+
32
+ type EmbindString = ArrayBuffer|Uint8Array|Uint8ClampedArray|Int8Array|string;
33
+ export interface ClassHandle {
34
+ isAliasOf(other: ClassHandle): boolean;
35
+ delete(): void;
36
+ deleteLater(): this;
37
+ isDeleted(): boolean;
38
+ // @ts-ignore - If targeting lower than ESNext, this symbol might not exist.
39
+ [Symbol.dispose](): void;
40
+ clone(): this;
41
+ }
42
+ export interface LogicalType extends ClassHandle {
43
+ isIntegral(): boolean;
44
+ isFloating(): boolean;
45
+ isNumeric(): boolean;
46
+ isTemporal(): boolean;
47
+ isValid(): boolean;
48
+ isComplete(): boolean;
49
+ isSigned(): boolean;
50
+ isUnsigned(): boolean;
51
+ hasAlias(): boolean;
52
+ id(): number;
53
+ physicalType(): number;
54
+ stringify(): string;
55
+ setAlias(_0: EmbindString): void;
56
+ getAlias(): string;
57
+ }
58
+
59
+ export interface Value extends ClassHandle {
60
+ type(): LogicalType;
61
+ copy(): Value;
62
+ isNull(): boolean;
63
+ getBoolean(): boolean;
64
+ getInt32(): number;
65
+ getFloat(): number;
66
+ getDouble(): number;
67
+ stringify(): string;
68
+ toSQLString(): string;
69
+ getString(): string;
70
+ }
71
+
72
+ export interface ErrorData extends ClassHandle {
73
+ hasError(): boolean;
74
+ message(): string;
75
+ rawMessage(): string;
76
+ }
77
+
78
+ export interface BaseQueryResult extends ClassHandle {
79
+ setError(_0: ErrorData): void;
80
+ hasError(): boolean;
81
+ resultType(): number;
82
+ statementType(): number;
83
+ columnCount(): bigint;
84
+ columnCount(): bigint;
85
+ throwError(_0: EmbindString): void;
86
+ getError(): string;
87
+ columnNames(): any;
88
+ columnTypes(): any;
89
+ }
90
+
91
+ export interface QueryResult extends BaseQueryResult {
92
+ print(): void;
93
+ stringify(): string;
94
+ columnName(_0: bigint): string;
95
+ }
96
+
97
+ export interface ColumnDataCollection extends ClassHandle {
98
+ count(): bigint;
99
+ columnCount(): bigint;
100
+ }
101
+
102
+ export interface MaterializedQueryResult extends QueryResult {
103
+ collection(): ColumnDataCollection;
104
+ rowCount(): bigint;
105
+ toJSON(): string;
106
+ getValue(_0: number, _1: number): any;
107
+ }
108
+
109
+ export interface PreparedStatement extends ClassHandle {
110
+ hasError(): boolean;
111
+ statementType(): number;
112
+ columnCount(): bigint;
113
+ getError(): string;
114
+ execute(_0: any): QueryResult | null;
115
+ names(): any;
116
+ types(): any;
117
+ }
118
+
119
+ export interface Connection extends ClassHandle {
120
+ interrupt(): void;
121
+ beginTransaction(): void;
122
+ commit(): void;
123
+ rollback(): void;
124
+ setAutoCommit(_0: boolean): void;
125
+ isAutoCommit(): boolean;
126
+ hasActiveTransaction(): boolean;
127
+ getQueryProgress(): number;
128
+ prepare(_0: EmbindString): PreparedStatement | null;
129
+ query(_0: EmbindString): MaterializedQueryResult | null;
130
+ }
131
+
132
+ export interface DuckDB extends ClassHandle {
133
+ connect(): Connection | null;
134
+ terminate(): void;
135
+ numberOfThreads(): bigint;
136
+ }
137
+
138
+ interface EmbindModule {
139
+ LogicalType: {
140
+ new(): LogicalType;
141
+ };
142
+ Value: {
143
+ new(): Value;
144
+ };
145
+ ErrorData: {
146
+ new(): ErrorData;
147
+ };
148
+ BaseQueryResult: {};
149
+ QueryResult: {};
150
+ ColumnDataCollection: {};
151
+ MaterializedQueryResult: {};
152
+ PreparedStatement: {};
153
+ Connection: {};
154
+ DuckDB: {
155
+ standardVectorSize(): number;
156
+ sourceID(): string;
157
+ libraryVersion(): string;
158
+ releaseCodename(): string;
159
+ platform(): string;
160
+ };
161
+ create(): DuckDB | null;
162
+ standardVectorSize(): number;
163
+ libraryVersion(): string;
164
+ sourceID(): string;
165
+ releaseCodename(): string;
166
+ platform(): string;
167
+ }
168
+
169
+ export type MainModule = WasmModule & typeof RuntimeExports & EmbindModule;
170
+ export default function MainModuleFactory (options?: unknown): Promise<MainModule>;
@@ -1,2 +0,0 @@
1
- export default function (): Uint8Array<ArrayBufferLike>;
2
- export declare function reset(): void;
@@ -1,2 +0,0 @@
1
- export default function (): Uint8Array<ArrayBufferLike>;
2
- export declare function reset(): void;
@@ -1,52 +0,0 @@
1
- import { AsyncDuckDB } from "@duckdb/duckdb-wasm";
2
- /**
3
- * DuckDB WASM library, a in-process SQL OLAP Database Management System..
4
- *
5
- * See [DuckDB](https://github.com/duckdb/duckdb) for more details.
6
- *
7
- * ```ts
8
- * import { DuckDB } from "@hpcc-js/wasm-duckdb";
9
- *
10
- * let duckdb = await DuckDB.load();
11
- * const c = await duckdb.db.connect();
12
- *
13
- * const data = [
14
- * { "col1": 1, "col2": "foo" },
15
- * { "col1": 2, "col2": "bar" },
16
- * ];
17
- * await duckdb.db.registerFileText("rows.json", JSON.stringify(data));
18
- * await c.insertJSONFromPath('rows.json', { name: 'rows' });
19
- *
20
- * const arrowResult = await c.query("SELECT * FROM read_json_auto('rows.json')");
21
- * const result = arrowResult.toArray().map((row) => row.toJSON());
22
- * expect(result.length).to.equal(data.length);
23
- * for (let i = 0; i < result.length; i++) {
24
- * expect(result[i].col2).to.equal(data[i].col2);
25
- * }
26
- *
27
- * c.close();
28
- * ```
29
- */
30
- export declare class DuckDB {
31
- protected _version: string;
32
- db: AsyncDuckDB;
33
- private constructor();
34
- /**
35
- * Compiles and instantiates the raw wasm.
36
- *
37
- * ::: info
38
- * In general WebAssembly compilation is disallowed on the main thread if the buffer size is larger than 4KB, hence forcing `load` to be asynchronous;
39
- * :::
40
- *
41
- * @returns A promise to an instance of the DuckDB class.
42
- */
43
- static load(): Promise<DuckDB>;
44
- /**
45
- * Unloades the compiled wasm instance.
46
- */
47
- static unload(): void;
48
- /**
49
- * @returns The DuckDB version
50
- */
51
- version(): string;
52
- }
File without changes