@motherduck/wasm-client 1.5.2-r.3 → 1.5.3-r.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/README.md +18 -0
- package/index.js +2 -2
- package/index_with_arrow.js +9 -9
- package/package.json +1 -1
- package/types/DuckDBInstance.d.ts +1 -1
- package/types/MDConnection.d.ts +1 -1
- package/types/MDConnectionParams.d.ts +1 -1
- package/types/MaterializedQueryTask.d.ts +2 -2
- package/types/QueryTypes.d.ts +3 -3
- package/types/StreamingQueryTask.d.ts +2 -2
- package/types/buildDuckDBBundleURLs.d.ts +1 -1
- package/types/createDuckDbConnection.d.ts +1 -1
- package/types/duckdbAccessModeFromString.d.ts +1 -1
- package/types/fetchDuckDBBundlesFromDuckDBAssets.d.ts +2 -0
- package/types/getAsyncDuckDb.d.ts +1 -1
- package/types/getVersionSuffix.d.ts +1 -0
- package/types/index.d.ts +4 -4
- package/types/instantiateDB.d.ts +1 -1
- package/types/isDuckDBBundles.d.ts +2 -0
- package/types/prefixDuckDBBundles.d.ts +2 -0
- package/types/readLocalFS.d.ts +1 -1
- package/types/@motherduck/wasm-extension/fetchVersion.d.ts +0 -1
package/README.md
CHANGED
|
@@ -70,8 +70,26 @@ await connection.isInitialized();
|
|
|
70
70
|
|
|
71
71
|
Multiple connections can be created. Connections share a DuckDB Wasm instance, so creating subsequent connections will not repeat the initialization process.
|
|
72
72
|
|
|
73
|
+
To reset the instance, see `terminateDuckDB` below.
|
|
74
|
+
|
|
73
75
|
Queries evaluated on different connections happen concurrently; queries evaluated on the same connection are queued sequentially.
|
|
74
76
|
|
|
77
|
+
### Terminating the DuckDB Instance
|
|
78
|
+
|
|
79
|
+
To terminate the DuckDB instance:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { terminateDuckDB } from '@motherduck/wasm-client';
|
|
83
|
+
|
|
84
|
+
await terminateDuckDB();
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This resets the internal, shared instance so it can be created again (with `MDConnection.create`), possibly with different parameters.
|
|
88
|
+
|
|
89
|
+
This is most useful for changing `mdToken`, either to refresh an expired (or near-expired) token, or to reconnect as a different user or with different permissions.
|
|
90
|
+
|
|
91
|
+
This terminates the local instance, in the browser, not the remote one in MotherDuck.
|
|
92
|
+
|
|
75
93
|
### Evaluating Queries
|
|
76
94
|
|
|
77
95
|
To evaluate a query, call the `evaluateQuery` method on the `connection` object:
|