@voltro/plugin-duckdb 0.86.0 → 0.87.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/dist/index.js CHANGED
@@ -7,7 +7,8 @@ var r = (r = {}) => {
7
7
  };
8
8
  return {
9
9
  kind: "duckdb",
10
- build: (t) => e(i, r),
10
+ sql: "none",
11
+ build: () => e(i, r),
11
12
  initialize: () => n(i, r),
12
13
  dispose: () => t(i)
13
14
  };
package/dist/sink.js CHANGED
@@ -188,11 +188,20 @@ var n = "duckdb", r = "voltro_events", i = null, a = () => i === null ? e.tryPro
188
188
  if (r.conn !== null) return;
189
189
  let o = yield* a(), s = yield* e.tryPromise({
190
190
  try: async () => {
191
- let e = await o.DuckDBInstance.create(i.path ?? ":memory:"), t = await e.connect();
192
- return await t.run(p), {
193
- instance: e,
194
- connection: t
195
- };
191
+ let e = await o.DuckDBInstance.create(i.path ?? ":memory:"), t;
192
+ try {
193
+ return t = await e.connect(), await t.run(p), {
194
+ instance: e,
195
+ connection: t
196
+ };
197
+ } catch (n) {
198
+ try {
199
+ t?.closeSync();
200
+ } finally {
201
+ e.closeSync();
202
+ }
203
+ throw n;
204
+ }
196
205
  },
197
206
  catch: (e) => new t({
198
207
  provider: n,
@@ -201,10 +210,14 @@ var n = "duckdb", r = "voltro_events", i = null, a = () => i === null ? e.tryPro
201
210
  })
202
211
  });
203
212
  r.instance = s.instance, r.conn = s.connection;
204
- }), E = (t) => e.gen(function* () {
213
+ }).pipe(e.uninterruptible, e.onError(() => E(r))), E = (t) => e.gen(function* () {
205
214
  let { conn: r, instance: i } = t;
206
215
  t.conn = null, t.instance = null, (r !== null || i !== null) && (yield* e.try(() => {
207
- r?.closeSync(), i?.closeSync();
216
+ try {
217
+ r?.closeSync();
218
+ } finally {
219
+ i?.closeSync();
220
+ }
208
221
  }).pipe(e.catch((t) => e.logWarning("duckdb analytics sink teardown failed", {
209
222
  provider: n,
210
223
  err: t
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plugin-duckdb",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "description": "Embedded DuckDB AnalyticsSink. Runs DuckDB in-process for real OLAP performance without an external service. Events land in a DuckDB column-store table; aggregate / timeseries / topN queries execute vectorized.",
5
5
  "keywords": [
6
6
  "voltro",
@@ -33,7 +33,7 @@
33
33
  "node": ">=24.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@voltro/runtime": "0.86.0"
36
+ "@voltro/runtime": "0.87.0"
37
37
  },
38
38
  "optionalDependencies": {
39
39
  "@duckdb/node-api": "1.5.5-r.5"