@hpcc-js/wasm-duckdb 1.11.0 → 1.13.0
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/README.md +581 -16
- package/dist/index.js +13 -10
- package/dist/index.js.map +4 -4
- package/package.json +12 -14
- package/src/duckdb.ts +253 -46
- package/types/__package__.d.ts +3 -0
- package/types/duckdb.d.ts +238 -0
- package/types/build/duckdb-browser-eh.worker.d.ts +0 -2
- package/types/build/duckdb-eh.wasm.d.ts +0 -2
- package/types/src/__package__.d.ts +0 -3
- package/types/src/duckdb.d.ts +0 -52
- /package/types/{src/index.d.ts → index.d.ts} +0 -0
package/types/src/duckdb.d.ts
DELETED
|
@@ -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
|