@query-farm/vgi 0.36.0 → 0.36.2
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/dist/client/types.d.ts +11 -0
- package/dist/client-entry.js +5 -1
- package/dist/client-entry.js.map +3 -3
- package/dist/index.js +5 -1
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/client/client.ts +4 -1
- package/src/client/types.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@query-farm/vgi",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.2",
|
|
4
4
|
"description": "TypeScript framework for extending DuckDB with user-defined functions via the Vector Gateway Interface (VGI) over Arrow IPC.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Query Farm LLC (https://query.farm)",
|
package/src/client/client.ts
CHANGED
|
@@ -422,7 +422,8 @@ export class VgiClient {
|
|
|
422
422
|
inputSession.close();
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
// Phase 2: FINALIZE
|
|
425
|
+
// Phase 2: FINALIZE — skipped entirely for a function with no finalize stage.
|
|
426
|
+
if (opts.hasFinalize === false) return;
|
|
426
427
|
const { session: finalizeSession } = await this._doInit(
|
|
427
428
|
bindReq,
|
|
428
429
|
bindResp,
|
|
@@ -502,6 +503,8 @@ export class VgiClient {
|
|
|
502
503
|
inputSession.close();
|
|
503
504
|
}
|
|
504
505
|
|
|
506
|
+
// FINALIZE — skipped entirely for a function with no finalize stage.
|
|
507
|
+
if (opts.hasFinalize === false) return;
|
|
505
508
|
const { session: finalizeSession } = await this._doInit(
|
|
506
509
|
bindReq,
|
|
507
510
|
bindResp,
|
package/src/client/types.ts
CHANGED
|
@@ -139,4 +139,15 @@ export interface TableInOutFunctionOptions {
|
|
|
139
139
|
joinKeys?: VgiBatch[];
|
|
140
140
|
/** Invoked after bind, before init. Receives the bind response. */
|
|
141
141
|
onBind?: BindResultCallback;
|
|
142
|
+
/**
|
|
143
|
+
* Whether the function declares a FINALIZE stage (`FunctionInfo.has_finalize`).
|
|
144
|
+
* Defaults to `true`, preserving the unconditional FINALIZE-phase `init()` every
|
|
145
|
+
* caller got before this option existed. Pass `false` for a function known to have
|
|
146
|
+
* no finalize — every blended row-transform function (`defineRowTransformFunction`,
|
|
147
|
+
* `FunctionInfo.input_from_args`) — to skip the FINALIZE `init()` entirely: the
|
|
148
|
+
* worker rejects an unexpected FINALIZE for a function that never advertised one.
|
|
149
|
+
* The DuckDB extension avoids it the same way (it registers no final callback).
|
|
150
|
+
* Mirrors vgi-python's `table_in_out_function(has_finalize=...)`.
|
|
151
|
+
*/
|
|
152
|
+
hasFinalize?: boolean;
|
|
142
153
|
}
|