@mastra/duckdb 1.4.0-alpha.0 → 1.4.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/CHANGELOG.md +22 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{observability-2MIUMLQP.js → observability-M35AJUGT.js} +39 -18
- package/dist/observability-M35AJUGT.js.map +1 -0
- package/dist/{observability-25HVQJC2.cjs → observability-V2KYD7UF.cjs} +39 -18
- package/dist/observability-V2KYD7UF.cjs.map +1 -0
- package/dist/storage/domains/observability/ddl.d.ts +5 -5
- package/dist/storage/domains/observability/ddl.d.ts.map +1 -1
- package/dist/storage/domains/observability/feedback.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/logs.d.ts.map +1 -1
- package/dist/storage/domains/observability/metrics.d.ts.map +1 -1
- package/dist/storage/domains/observability/migration.d.ts +14 -0
- package/dist/storage/domains/observability/migration.d.ts.map +1 -1
- package/dist/storage/domains/observability/scores.d.ts.map +1 -1
- package/dist/storage/domains/observability/tracing.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/observability-25HVQJC2.cjs.map +0 -1
- package/dist/observability-2MIUMLQP.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/duckdb
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added delta polling support for observability list APIs in core, DuckDB, and ClickHouse. ([#16632](https://github.com/mastra-ai/mastra/pull/16632))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Fixed DuckDB observability storage so dev server restarts no longer fail when replaying cursor migrations. ([#16803](https://github.com/mastra-ai/mastra/pull/16803))
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`452036a`](https://github.com/mastra-ai/mastra/commit/452036a0d965b4f4c1efd93606e4f03b50b807a5), [`c272d50`](https://github.com/mastra-ai/mastra/commit/c272d50610a54496b6b6d92ccd4d37b333a2613a), [`27fd1b7`](https://github.com/mastra-ai/mastra/commit/27fd1b79ac62eb7694f92587eb7d1be05b59be01), [`5ba7253`](https://github.com/mastra-ai/mastra/commit/5ba7253745c85e8df8012a76d954c640ffa336f7), [`5556cc1`](https://github.com/mastra-ai/mastra/commit/5556cc1befec71518d84f826b3bfe3a079a9daf7), [`f73980d`](https://github.com/mastra-ai/mastra/commit/f73980d651eb5f7f1ab20582de4615a1b6f10fce), [`5499303`](https://github.com/mastra-ai/mastra/commit/54993032c1ebc09642625b78d2014e0cf84a3cae), [`a702009`](https://github.com/mastra-ai/mastra/commit/a702009d3cfaa745120f501e21c783ed4d6a3072), [`9aee493`](https://github.com/mastra-ai/mastra/commit/9aee493ed6089b5133472623dcce49934bf2d509), [`d8692af`](https://github.com/mastra-ai/mastra/commit/d8692afa253028e39cdce2aafa0ac414071a762e), [`1a9cc60`](https://github.com/mastra-ai/mastra/commit/1a9cc6069f9910fc3d59e4953ac8cd95d89ad6f5), [`8cdb86c`](https://github.com/mastra-ai/mastra/commit/8cdb86ceed1137bc2768e147dce85a0692b9fb26), [`8534d79`](https://github.com/mastra-ai/mastra/commit/8534d791fa1cb70fe1c19e2604c4b63cc10dd051), [`eda90c5`](https://github.com/mastra-ai/mastra/commit/eda90c5bfd7de11805ecc9f4552716c895fbaf78), [`a935b0a`](https://github.com/mastra-ai/mastra/commit/a935b0a0977ae3f196b33ec7621f528069c82db0), [`9c88701`](https://github.com/mastra-ai/mastra/commit/9c8870195b41a38dc40b6ba2aa55eda04df8fa69), [`c78f8cd`](https://github.com/mastra-ai/mastra/commit/c78f8cd6222a86e6c60ae5210b6929ad5221b6fb), [`e146aad`](https://github.com/mastra-ai/mastra/commit/e146aadbba66c410ba0e74bac4c50135495cb8dd), [`ac79462`](https://github.com/mastra-ai/mastra/commit/ac79462b98f1062394c45093aa515b0766f27ee2), [`1a0ec78`](https://github.com/mastra-ai/mastra/commit/1a0ec789a26cae443744e9abbd62ed6ee676af39), [`e47bca7`](https://github.com/mastra-ai/mastra/commit/e47bca7b72866d3abd173b9f530ac4318113a8ff), [`afc004f`](https://github.com/mastra-ai/mastra/commit/afc004f5cc7e30697809e7021820b9f5881e6719), [`0031d0f`](https://github.com/mastra-ai/mastra/commit/0031d0f13831d7843ac5d498734a7d92862e2ce3), [`841a222`](https://github.com/mastra-ai/mastra/commit/841a222560d8c19238f8213713f30535cdd82284), [`64c1e0b`](https://github.com/mastra-ai/mastra/commit/64c1e0b35165c96b659818bd0177aa18794ef11f), [`40d83a9`](https://github.com/mastra-ai/mastra/commit/40d83a90d9be31a1b83e04649edb703eb7753e33), [`4e88dc6`](https://github.com/mastra-ai/mastra/commit/4e88dc6b89f154c0eae37221c8126be0c23c569f), [`19018f0`](https://github.com/mastra-ai/mastra/commit/19018f05722af74a5978781a7731a654b26f7f2a), [`19281c7`](https://github.com/mastra-ai/mastra/commit/19281c70424f757219782de16c2699743c5e04d0), [`3498b49`](https://github.com/mastra-ai/mastra/commit/3498b4946be94f4313cd817733589680dcda5278), [`d52b6fe`](https://github.com/mastra-ai/mastra/commit/d52b6fe1c56853eb38864baae0bbfa75cc739ccb), [`408be73`](https://github.com/mastra-ai/mastra/commit/408be73449dfab92b51eab8c6623b6c443debc25), [`359439b`](https://github.com/mastra-ai/mastra/commit/359439bb8c635e048176306828195f8297f50021), [`71a820b`](https://github.com/mastra-ai/mastra/commit/71a820b2353fa1406772c50760a3732058a8b337), [`1698f5e`](https://github.com/mastra-ai/mastra/commit/1698f5ec141d34f22a873efdb145ce3cdf848a5e)]:
|
|
14
|
+
- @mastra/core@1.36.0
|
|
15
|
+
|
|
16
|
+
## 1.4.0-alpha.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Fixed DuckDB observability storage so dev server restarts no longer fail when replaying cursor migrations. ([#16803](https://github.com/mastra-ai/mastra/pull/16803))
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`9aee493`](https://github.com/mastra-ai/mastra/commit/9aee493ed6089b5133472623dcce49934bf2d509)]:
|
|
23
|
+
- @mastra/core@1.36.0-alpha.8
|
|
24
|
+
|
|
3
25
|
## 1.4.0-alpha.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -586,7 +586,7 @@ var ObservabilityStorageDuckDB = class extends storage.ObservabilityStorage {
|
|
|
586
586
|
return null;
|
|
587
587
|
}
|
|
588
588
|
if (!this.loadPromise) {
|
|
589
|
-
this.loadPromise = import('./observability-
|
|
589
|
+
this.loadPromise = import('./observability-V2KYD7UF.cjs').then(({ ObservabilityStorageDuckDB: ObservabilityStorageDuckDB2 }) => {
|
|
590
590
|
const delegate = new ObservabilityStorageDuckDB2({ db: this.db });
|
|
591
591
|
this.delegate = delegate;
|
|
592
592
|
return delegate;
|
package/dist/index.js
CHANGED
|
@@ -585,7 +585,7 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
|
|
|
585
585
|
return null;
|
|
586
586
|
}
|
|
587
587
|
if (!this.loadPromise) {
|
|
588
|
-
this.loadPromise = import('./observability-
|
|
588
|
+
this.loadPromise = import('./observability-M35AJUGT.js').then(({ ObservabilityStorageDuckDB: ObservabilityStorageDuckDB2 }) => {
|
|
589
589
|
const delegate = new ObservabilityStorageDuckDB2({ db: this.db });
|
|
590
590
|
this.delegate = delegate;
|
|
591
591
|
return delegate;
|
|
@@ -26,7 +26,7 @@ CREATE TABLE IF NOT EXISTS span_events (
|
|
|
26
26
|
-- Event metadata
|
|
27
27
|
eventType VARCHAR NOT NULL,
|
|
28
28
|
timestamp TIMESTAMP NOT NULL,
|
|
29
|
-
cursorId BIGINT
|
|
29
|
+
cursorId BIGINT,
|
|
30
30
|
|
|
31
31
|
-- IDs
|
|
32
32
|
traceId VARCHAR NOT NULL,
|
|
@@ -73,7 +73,7 @@ var METRIC_EVENTS_DDL = `
|
|
|
73
73
|
CREATE TABLE IF NOT EXISTS metric_events (
|
|
74
74
|
-- Event metadata
|
|
75
75
|
timestamp TIMESTAMP NOT NULL,
|
|
76
|
-
cursorId BIGINT
|
|
76
|
+
cursorId BIGINT,
|
|
77
77
|
|
|
78
78
|
-- IDs
|
|
79
79
|
metricId VARCHAR NOT NULL PRIMARY KEY,
|
|
@@ -126,7 +126,7 @@ var LOG_EVENTS_DDL = `
|
|
|
126
126
|
CREATE TABLE IF NOT EXISTS log_events (
|
|
127
127
|
-- Event metadata
|
|
128
128
|
timestamp TIMESTAMP NOT NULL,
|
|
129
|
-
cursorId BIGINT
|
|
129
|
+
cursorId BIGINT,
|
|
130
130
|
|
|
131
131
|
-- IDs
|
|
132
132
|
logId VARCHAR NOT NULL PRIMARY KEY,
|
|
@@ -174,7 +174,7 @@ var SCORE_EVENTS_DDL = `
|
|
|
174
174
|
CREATE TABLE IF NOT EXISTS score_events (
|
|
175
175
|
-- Event metadata
|
|
176
176
|
timestamp TIMESTAMP NOT NULL,
|
|
177
|
-
cursorId BIGINT
|
|
177
|
+
cursorId BIGINT,
|
|
178
178
|
|
|
179
179
|
-- IDs
|
|
180
180
|
scoreId VARCHAR NOT NULL PRIMARY KEY,
|
|
@@ -226,7 +226,7 @@ var FEEDBACK_EVENTS_DDL = `
|
|
|
226
226
|
CREATE TABLE IF NOT EXISTS feedback_events (
|
|
227
227
|
-- Event metadata
|
|
228
228
|
timestamp TIMESTAMP NOT NULL,
|
|
229
|
-
cursorId BIGINT
|
|
229
|
+
cursorId BIGINT,
|
|
230
230
|
|
|
231
231
|
-- IDs
|
|
232
232
|
feedbackId VARCHAR NOT NULL PRIMARY KEY,
|
|
@@ -293,14 +293,16 @@ var ALL_MIGRATIONS = [
|
|
|
293
293
|
`CREATE SEQUENCE IF NOT EXISTS log_events_cursor_id_seq START 1`,
|
|
294
294
|
`CREATE SEQUENCE IF NOT EXISTS score_events_cursor_id_seq START 1`,
|
|
295
295
|
`CREATE SEQUENCE IF NOT EXISTS feedback_events_cursor_id_seq START 1`,
|
|
296
|
-
//
|
|
297
|
-
//
|
|
296
|
+
// Existing rows intentionally keep NULL cursorId values; delta polling only
|
|
297
|
+
// applies to rows written by insert paths that explicitly call nextval().
|
|
298
|
+
// Databases upgraded from a prior version may still carry a
|
|
299
|
+
// `DEFAULT nextval(...)` on cursorId, which breaks DuckDB WAL replay; that
|
|
300
|
+
// remediation lives in `dropLegacyCursorIdDefaults` and only runs when the
|
|
301
|
+
// bad default is detected in information_schema.
|
|
298
302
|
`ALTER TABLE span_events ADD COLUMN IF NOT EXISTS cursorId BIGINT`,
|
|
299
|
-
`ALTER TABLE span_events ALTER COLUMN cursorId SET DEFAULT nextval('span_events_cursor_id_seq')`,
|
|
300
303
|
`ALTER TABLE span_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
|
|
301
304
|
// Metrics. Legacy rows remain page-visible but are not part of delta polling.
|
|
302
305
|
`ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS cursorId BIGINT`,
|
|
303
|
-
`ALTER TABLE metric_events ALTER COLUMN cursorId SET DEFAULT nextval('metric_events_cursor_id_seq')`,
|
|
304
306
|
`ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
|
|
305
307
|
`ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
|
|
306
308
|
`ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
|
|
@@ -326,7 +328,6 @@ var ALL_MIGRATIONS = [
|
|
|
326
328
|
`ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS scope JSON`,
|
|
327
329
|
// Logs. Legacy rows remain page-visible but are not part of delta polling.
|
|
328
330
|
`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS cursorId BIGINT`,
|
|
329
|
-
`ALTER TABLE log_events ALTER COLUMN cursorId SET DEFAULT nextval('log_events_cursor_id_seq')`,
|
|
330
331
|
`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
|
|
331
332
|
`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
|
|
332
333
|
`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
|
|
@@ -352,7 +353,6 @@ var ALL_MIGRATIONS = [
|
|
|
352
353
|
`ALTER TABLE log_events ADD COLUMN IF NOT EXISTS scope JSON`,
|
|
353
354
|
// Scores. Legacy rows remain page-visible but are not part of delta polling.
|
|
354
355
|
`ALTER TABLE score_events ADD COLUMN IF NOT EXISTS cursorId BIGINT`,
|
|
355
|
-
`ALTER TABLE score_events ALTER COLUMN cursorId SET DEFAULT nextval('score_events_cursor_id_seq')`,
|
|
356
356
|
`ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
|
|
357
357
|
`ALTER TABLE score_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
|
|
358
358
|
`ALTER TABLE score_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
|
|
@@ -382,7 +382,6 @@ var ALL_MIGRATIONS = [
|
|
|
382
382
|
`ALTER TABLE score_events ALTER COLUMN traceId DROP NOT NULL`,
|
|
383
383
|
// Feedback. Legacy rows remain page-visible but are not part of delta polling.
|
|
384
384
|
`ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS cursorId BIGINT`,
|
|
385
|
-
`ALTER TABLE feedback_events ALTER COLUMN cursorId SET DEFAULT nextval('feedback_events_cursor_id_seq')`,
|
|
386
385
|
`ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
|
|
387
386
|
`ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
|
|
388
387
|
`ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
|
|
@@ -881,7 +880,7 @@ async function createFeedback(db, args) {
|
|
|
881
880
|
const feedbackUserId = f.feedbackUserId ?? f.userId ?? null;
|
|
882
881
|
await db.execute(
|
|
883
882
|
`INSERT INTO feedback_events (
|
|
884
|
-
feedbackId, timestamp, traceId, spanId, experimentId,
|
|
883
|
+
feedbackId, timestamp, cursorId, traceId, spanId, experimentId,
|
|
885
884
|
entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
|
|
886
885
|
userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
|
|
887
886
|
feedbackUserId, sourceId, feedbackSource, feedbackType, value, comment, tags, metadata, scope
|
|
@@ -889,6 +888,7 @@ async function createFeedback(db, args) {
|
|
|
889
888
|
VALUES (${[
|
|
890
889
|
v(f.feedbackId),
|
|
891
890
|
v(f.timestamp),
|
|
891
|
+
"nextval('feedback_events_cursor_id_seq')",
|
|
892
892
|
v(f.traceId),
|
|
893
893
|
v(f.spanId ?? null),
|
|
894
894
|
v(f.experimentId ?? null),
|
|
@@ -936,6 +936,7 @@ async function batchCreateFeedback(db, args) {
|
|
|
936
936
|
return `(${[
|
|
937
937
|
v(legacyFeedback.feedbackId),
|
|
938
938
|
v(legacyFeedback.timestamp),
|
|
939
|
+
"nextval('feedback_events_cursor_id_seq')",
|
|
939
940
|
v(legacyFeedback.traceId),
|
|
940
941
|
v(legacyFeedback.spanId ?? null),
|
|
941
942
|
v(legacyFeedback.experimentId ?? null),
|
|
@@ -974,7 +975,7 @@ async function batchCreateFeedback(db, args) {
|
|
|
974
975
|
});
|
|
975
976
|
await db.execute(
|
|
976
977
|
`INSERT INTO feedback_events (
|
|
977
|
-
feedbackId, timestamp, traceId, spanId, experimentId,
|
|
978
|
+
feedbackId, timestamp, cursorId, traceId, spanId, experimentId,
|
|
978
979
|
entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
|
|
979
980
|
userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
|
|
980
981
|
feedbackUserId, sourceId, feedbackSource, feedbackType, value, comment, tags, metadata, scope
|
|
@@ -1180,6 +1181,7 @@ async function getFeedbackPercentiles(db, args) {
|
|
|
1180
1181
|
var COLUMNS = [
|
|
1181
1182
|
"logId",
|
|
1182
1183
|
"timestamp",
|
|
1184
|
+
"cursorId",
|
|
1183
1185
|
"level",
|
|
1184
1186
|
"message",
|
|
1185
1187
|
"data",
|
|
@@ -1256,6 +1258,7 @@ async function batchCreateLogs(db, args) {
|
|
|
1256
1258
|
return `(${[
|
|
1257
1259
|
v(log.logId),
|
|
1258
1260
|
v(log.timestamp),
|
|
1261
|
+
"nextval('log_events_cursor_id_seq')",
|
|
1259
1262
|
v(log.level),
|
|
1260
1263
|
v(log.message),
|
|
1261
1264
|
jsonV(log.data),
|
|
@@ -1414,6 +1417,7 @@ function buildMetricNameFilter(name) {
|
|
|
1414
1417
|
var METRIC_COLUMNS = [
|
|
1415
1418
|
"metricId",
|
|
1416
1419
|
"timestamp",
|
|
1420
|
+
"cursorId",
|
|
1417
1421
|
"name",
|
|
1418
1422
|
"value",
|
|
1419
1423
|
"traceId",
|
|
@@ -1562,6 +1566,7 @@ async function batchCreateMetrics(db, args) {
|
|
|
1562
1566
|
return `(${[
|
|
1563
1567
|
v(m.metricId),
|
|
1564
1568
|
v(m.timestamp),
|
|
1569
|
+
"nextval('metric_events_cursor_id_seq')",
|
|
1565
1570
|
v(m.name),
|
|
1566
1571
|
v(m.value),
|
|
1567
1572
|
v(m.traceId ?? null),
|
|
@@ -1948,6 +1953,17 @@ async function getMetricLabelValues(db, args) {
|
|
|
1948
1953
|
);
|
|
1949
1954
|
return { values: rows.map((r) => r.val) };
|
|
1950
1955
|
}
|
|
1956
|
+
var CURSOR_ID_TABLES = ["span_events", "metric_events", "log_events", "score_events", "feedback_events"];
|
|
1957
|
+
async function dropLegacyCursorIdDefaults(db) {
|
|
1958
|
+
const rows = await db.query(
|
|
1959
|
+
`SELECT table_name FROM information_schema.columns
|
|
1960
|
+
WHERE column_name = 'cursorId'
|
|
1961
|
+
AND column_default IS NOT NULL
|
|
1962
|
+
AND table_name IN (${CURSOR_ID_TABLES.map((t) => `'${t}'`).join(", ")})`
|
|
1963
|
+
);
|
|
1964
|
+
if (rows.length === 0) return;
|
|
1965
|
+
await db.executeBatch(rows.map((row) => `ALTER TABLE ${row.table_name} ALTER COLUMN cursorId DROP DEFAULT`));
|
|
1966
|
+
}
|
|
1951
1967
|
var SIGNAL_MIGRATIONS = [
|
|
1952
1968
|
{
|
|
1953
1969
|
table: "metric_events",
|
|
@@ -2271,7 +2287,7 @@ async function createScore(db, args) {
|
|
|
2271
2287
|
const scoreSource = s.scoreSource ?? s.source ?? null;
|
|
2272
2288
|
await db.execute(
|
|
2273
2289
|
`INSERT INTO score_events (
|
|
2274
|
-
scoreId, timestamp, traceId, spanId, experimentId, scoreTraceId,
|
|
2290
|
+
scoreId, timestamp, cursorId, traceId, spanId, experimentId, scoreTraceId,
|
|
2275
2291
|
entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
|
|
2276
2292
|
userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
|
|
2277
2293
|
scorerId, scorerVersion, scoreSource, score, reason, tags, metadata, scope
|
|
@@ -2279,6 +2295,7 @@ async function createScore(db, args) {
|
|
|
2279
2295
|
VALUES (${[
|
|
2280
2296
|
v(s.scoreId),
|
|
2281
2297
|
v(s.timestamp),
|
|
2298
|
+
"nextval('score_events_cursor_id_seq')",
|
|
2282
2299
|
v(s.traceId),
|
|
2283
2300
|
v(s.spanId ?? null),
|
|
2284
2301
|
v(s.experimentId ?? null),
|
|
@@ -2325,6 +2342,7 @@ async function batchCreateScores(db, args) {
|
|
|
2325
2342
|
return `(${[
|
|
2326
2343
|
v(legacyScore.scoreId),
|
|
2327
2344
|
v(legacyScore.timestamp),
|
|
2345
|
+
"nextval('score_events_cursor_id_seq')",
|
|
2328
2346
|
v(legacyScore.traceId),
|
|
2329
2347
|
v(legacyScore.spanId ?? null),
|
|
2330
2348
|
v(legacyScore.experimentId ?? null),
|
|
@@ -2363,7 +2381,7 @@ async function batchCreateScores(db, args) {
|
|
|
2363
2381
|
});
|
|
2364
2382
|
await db.execute(
|
|
2365
2383
|
`INSERT INTO score_events (
|
|
2366
|
-
scoreId, timestamp, traceId, spanId, experimentId, scoreTraceId,
|
|
2384
|
+
scoreId, timestamp, cursorId, traceId, spanId, experimentId, scoreTraceId,
|
|
2367
2385
|
entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
|
|
2368
2386
|
userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
|
|
2369
2387
|
scorerId, scorerVersion, scoreSource, score, reason, tags, metadata, scope
|
|
@@ -2571,6 +2589,7 @@ async function getScorePercentiles(db, args) {
|
|
|
2571
2589
|
var COLUMNS2 = [
|
|
2572
2590
|
"eventType",
|
|
2573
2591
|
"timestamp",
|
|
2592
|
+
"cursorId",
|
|
2574
2593
|
"traceId",
|
|
2575
2594
|
"spanId",
|
|
2576
2595
|
"parentSpanId",
|
|
@@ -2803,6 +2822,7 @@ function toValuesTuple(row) {
|
|
|
2803
2822
|
return [
|
|
2804
2823
|
v(row.eventType),
|
|
2805
2824
|
v(row.timestamp),
|
|
2825
|
+
"nextval('span_events_cursor_id_seq')",
|
|
2806
2826
|
v(row.traceId),
|
|
2807
2827
|
v(row.spanId),
|
|
2808
2828
|
v(row.parentSpanId),
|
|
@@ -3603,6 +3623,7 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
|
|
|
3603
3623
|
});
|
|
3604
3624
|
}
|
|
3605
3625
|
await this.db.executeBatch([...ALL_DDL, ...ALL_MIGRATIONS]);
|
|
3626
|
+
await dropLegacyCursorIdDefaults(this.db);
|
|
3606
3627
|
}
|
|
3607
3628
|
/**
|
|
3608
3629
|
* Manually migrate legacy signal tables to the signal-ID primary-key schema.
|
|
@@ -3781,5 +3802,5 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
|
|
|
3781
3802
|
};
|
|
3782
3803
|
|
|
3783
3804
|
export { ObservabilityStorageDuckDB };
|
|
3784
|
-
//# sourceMappingURL=observability-
|
|
3785
|
-
//# sourceMappingURL=observability-
|
|
3805
|
+
//# sourceMappingURL=observability-M35AJUGT.js.map
|
|
3806
|
+
//# sourceMappingURL=observability-M35AJUGT.js.map
|