@hpcc-js/wasm-duckdb 1.13.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/wasm-duckdb",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "hpcc-js - WASM DuckDB",
5
5
  "type": "module",
6
6
  "exports": {
@@ -55,5 +55,5 @@
55
55
  },
56
56
  "homepage": "https://hpcc-systems.github.io/hpcc-js-wasm/",
57
57
  "license": "Apache-2.0",
58
- "gitHead": "6799e024fc9186c4a4f87294862142f00628e597"
58
+ "gitHead": "11395f5acfc865accde71905509bb45d5c79b11b"
59
59
  }
package/src/duckdb.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // @ts-expect-error importing from a wasm file is resolved via a custom esbuild plugin
2
2
  import load, { reset } from "../../../build/packages/duckdb/duckdblib.wasm";
3
- import type { MainModule, DuckDB as CPPDuckDB } from "../../../build/packages/duckdb/duckdblib.js";
3
+ import type { MainModule, DuckDB as CPPDuckDB } from "../types/duckdblib.js";
4
4
  import { MainModuleEx } from "@hpcc-js/wasm-util";
5
5
 
6
6
  let g_duckdb: Promise<DuckDB>;
package/types/duckdb.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MainModule, DuckDB as CPPDuckDB } from "../../../build/packages/duckdb/duckdblib.js";
1
+ import type { MainModule, DuckDB as CPPDuckDB } from "../types/duckdblib.js";
2
2
  import { MainModuleEx } from "@hpcc-js/wasm-util";
3
3
  /**
4
4
  * DuckDB WASM library - an in-process SQL OLAP Database Management System.
@@ -151,7 +151,7 @@ export declare class DuckDB extends MainModuleEx<MainModule> {
151
151
  * connection.delete(); // Important: clean up!
152
152
  * ```
153
153
  */
154
- connect(): import("../../../build/packages/duckdb/duckdblib.js").Connection;
154
+ connect(): import("../types/duckdblib.js").Connection;
155
155
  /**
156
156
  * Returns the number of threads available to DuckDB.
157
157
  *
@@ -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>;