@mastra/duckdb 1.1.1 → 1.1.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.
@@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS span_events (
20
20
  entityType VARCHAR,
21
21
  entityId VARCHAR,
22
22
  entityName VARCHAR,
23
+ entityVersionId VARCHAR,
23
24
 
24
25
  -- Context
25
26
  userId VARCHAR,
@@ -64,9 +65,12 @@ CREATE TABLE IF NOT EXISTS metric_events (
64
65
  entityType VARCHAR,
65
66
  entityId VARCHAR,
66
67
  entityName VARCHAR,
68
+ entityVersionId VARCHAR,
69
+ parentEntityVersionId VARCHAR,
67
70
  parentEntityType VARCHAR,
68
71
  parentEntityId VARCHAR,
69
72
  parentEntityName VARCHAR,
73
+ rootEntityVersionId VARCHAR,
70
74
  rootEntityType VARCHAR,
71
75
  rootEntityId VARCHAR,
72
76
  rootEntityName VARCHAR,
@@ -112,9 +116,12 @@ CREATE TABLE IF NOT EXISTS log_events (
112
116
  entityType VARCHAR,
113
117
  entityId VARCHAR,
114
118
  entityName VARCHAR,
119
+ entityVersionId VARCHAR,
120
+ parentEntityVersionId VARCHAR,
115
121
  parentEntityType VARCHAR,
116
122
  parentEntityId VARCHAR,
117
123
  parentEntityName VARCHAR,
124
+ rootEntityVersionId VARCHAR,
118
125
  rootEntityType VARCHAR,
119
126
  rootEntityId VARCHAR,
120
127
  rootEntityName VARCHAR,
@@ -156,9 +163,12 @@ CREATE TABLE IF NOT EXISTS score_events (
156
163
  entityType VARCHAR,
157
164
  entityId VARCHAR,
158
165
  entityName VARCHAR,
166
+ entityVersionId VARCHAR,
167
+ parentEntityVersionId VARCHAR,
159
168
  parentEntityType VARCHAR,
160
169
  parentEntityId VARCHAR,
161
170
  parentEntityName VARCHAR,
171
+ rootEntityVersionId VARCHAR,
162
172
  rootEntityType VARCHAR,
163
173
  rootEntityId VARCHAR,
164
174
  rootEntityName VARCHAR,
@@ -201,9 +211,12 @@ CREATE TABLE IF NOT EXISTS feedback_events (
201
211
  entityType VARCHAR,
202
212
  entityId VARCHAR,
203
213
  entityName VARCHAR,
214
+ entityVersionId VARCHAR,
215
+ parentEntityVersionId VARCHAR,
204
216
  parentEntityType VARCHAR,
205
217
  parentEntityId VARCHAR,
206
218
  parentEntityName VARCHAR,
219
+ rootEntityVersionId VARCHAR,
207
220
  rootEntityType VARCHAR,
208
221
  rootEntityId VARCHAR,
209
222
  rootEntityName VARCHAR,
@@ -238,7 +251,12 @@ CREATE TABLE IF NOT EXISTS feedback_events (
238
251
  )`;
239
252
  var ALL_DDL = [SPAN_EVENTS_DDL, METRIC_EVENTS_DDL, LOG_EVENTS_DDL, SCORE_EVENTS_DDL, FEEDBACK_EVENTS_DDL];
240
253
  var ALL_MIGRATIONS = [
254
+ // Span events
255
+ `ALTER TABLE span_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
241
256
  // Metrics
257
+ `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
258
+ `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
259
+ `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
242
260
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS experimentId VARCHAR`,
243
261
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityType VARCHAR`,
244
262
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS parentEntityId VARCHAR`,
@@ -260,6 +278,9 @@ var ALL_MIGRATIONS = [
260
278
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS metadata JSON`,
261
279
  `ALTER TABLE metric_events ADD COLUMN IF NOT EXISTS scope JSON`,
262
280
  // Logs
281
+ `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
282
+ `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
283
+ `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
263
284
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS experimentId VARCHAR`,
264
285
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityType VARCHAR`,
265
286
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS parentEntityId VARCHAR`,
@@ -281,6 +302,9 @@ var ALL_MIGRATIONS = [
281
302
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS metadata JSON`,
282
303
  `ALTER TABLE log_events ADD COLUMN IF NOT EXISTS scope JSON`,
283
304
  // Scores
305
+ `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
306
+ `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
307
+ `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
284
308
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityType VARCHAR`,
285
309
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityId VARCHAR`,
286
310
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS entityName VARCHAR`,
@@ -306,6 +330,9 @@ var ALL_MIGRATIONS = [
306
330
  `ALTER TABLE score_events ADD COLUMN IF NOT EXISTS scoreSource VARCHAR`,
307
331
  `ALTER TABLE score_events ALTER COLUMN traceId DROP NOT NULL`,
308
332
  // Feedback
333
+ `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityVersionId VARCHAR`,
334
+ `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS parentEntityVersionId VARCHAR`,
335
+ `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS rootEntityVersionId VARCHAR`,
309
336
  `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityType VARCHAR`,
310
337
  `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityId VARCHAR`,
311
338
  `ALTER TABLE feedback_events ADD COLUMN IF NOT EXISTS entityName VARCHAR`,
@@ -576,9 +603,12 @@ var FEEDBACK_GROUP_BY_COLUMNS = /* @__PURE__ */ new Set([
576
603
  "entityType",
577
604
  "entityId",
578
605
  "entityName",
606
+ "entityVersionId",
607
+ "parentEntityVersionId",
579
608
  "parentEntityType",
580
609
  "parentEntityId",
581
610
  "parentEntityName",
611
+ "rootEntityVersionId",
582
612
  "rootEntityType",
583
613
  "rootEntityId",
584
614
  "rootEntityName",
@@ -694,9 +724,12 @@ function rowToFeedbackRecord(row) {
694
724
  entityType: row.entityType ?? null,
695
725
  entityId: row.entityId ?? null,
696
726
  entityName: row.entityName ?? null,
727
+ entityVersionId: row.entityVersionId ?? null,
728
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
697
729
  parentEntityType: row.parentEntityType ?? null,
698
730
  parentEntityId: row.parentEntityId ?? null,
699
731
  parentEntityName: row.parentEntityName ?? null,
732
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
700
733
  rootEntityType: row.rootEntityType ?? null,
701
734
  rootEntityId: row.rootEntityId ?? null,
702
735
  rootEntityName: row.rootEntityName ?? null,
@@ -756,7 +789,7 @@ async function createFeedback(db, args) {
756
789
  await db.execute(
757
790
  `INSERT INTO feedback_events (
758
791
  timestamp, traceId, spanId, experimentId,
759
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
792
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
760
793
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
761
794
  feedbackUserId, sourceId, feedbackSource, feedbackType, value, comment, tags, metadata, scope
762
795
  )
@@ -768,9 +801,12 @@ async function createFeedback(db, args) {
768
801
  v(f.entityType ?? null),
769
802
  v(f.entityId ?? null),
770
803
  v(f.entityName ?? null),
804
+ v(f.entityVersionId ?? null),
805
+ v(f.parentEntityVersionId ?? null),
771
806
  v(f.parentEntityType ?? null),
772
807
  v(f.parentEntityId ?? null),
773
808
  v(f.parentEntityName ?? null),
809
+ v(f.rootEntityVersionId ?? null),
774
810
  v(f.rootEntityType ?? null),
775
811
  v(f.rootEntityId ?? null),
776
812
  v(f.rootEntityName ?? null),
@@ -810,9 +846,12 @@ async function batchCreateFeedback(db, args) {
810
846
  v(legacyFeedback.entityType ?? null),
811
847
  v(legacyFeedback.entityId ?? null),
812
848
  v(legacyFeedback.entityName ?? null),
849
+ v(legacyFeedback.entityVersionId ?? null),
850
+ v(legacyFeedback.parentEntityVersionId ?? null),
813
851
  v(legacyFeedback.parentEntityType ?? null),
814
852
  v(legacyFeedback.parentEntityId ?? null),
815
853
  v(legacyFeedback.parentEntityName ?? null),
854
+ v(legacyFeedback.rootEntityVersionId ?? null),
816
855
  v(legacyFeedback.rootEntityType ?? null),
817
856
  v(legacyFeedback.rootEntityId ?? null),
818
857
  v(legacyFeedback.rootEntityName ?? null),
@@ -840,7 +879,7 @@ async function batchCreateFeedback(db, args) {
840
879
  await db.execute(
841
880
  `INSERT INTO feedback_events (
842
881
  timestamp, traceId, spanId, experimentId,
843
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
882
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
844
883
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
845
884
  feedbackUserId, sourceId, feedbackSource, feedbackType, value, comment, tags, metadata, scope
846
885
  )
@@ -1010,9 +1049,12 @@ var COLUMNS = [
1010
1049
  "entityType",
1011
1050
  "entityId",
1012
1051
  "entityName",
1052
+ "entityVersionId",
1053
+ "parentEntityVersionId",
1013
1054
  "parentEntityType",
1014
1055
  "parentEntityId",
1015
1056
  "parentEntityName",
1057
+ "rootEntityVersionId",
1016
1058
  "rootEntityType",
1017
1059
  "rootEntityId",
1018
1060
  "rootEntityName",
@@ -1043,9 +1085,12 @@ function rowToLogRecord(row) {
1043
1085
  entityType: row.entityType ?? null,
1044
1086
  entityId: row.entityId ?? null,
1045
1087
  entityName: row.entityName ?? null,
1088
+ entityVersionId: row.entityVersionId ?? null,
1089
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
1046
1090
  parentEntityType: row.parentEntityType ?? null,
1047
1091
  parentEntityId: row.parentEntityId ?? null,
1048
1092
  parentEntityName: row.parentEntityName ?? null,
1093
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
1049
1094
  rootEntityType: row.rootEntityType ?? null,
1050
1095
  rootEntityId: row.rootEntityId ?? null,
1051
1096
  rootEntityName: row.rootEntityName ?? null,
@@ -1078,9 +1123,12 @@ async function batchCreateLogs(db, args) {
1078
1123
  v(log.entityType ?? null),
1079
1124
  v(log.entityId ?? null),
1080
1125
  v(log.entityName ?? null),
1126
+ v(log.entityVersionId ?? null),
1127
+ v(log.parentEntityVersionId ?? null),
1081
1128
  v(log.parentEntityType ?? null),
1082
1129
  v(log.parentEntityId ?? null),
1083
1130
  v(log.parentEntityName ?? null),
1131
+ v(log.rootEntityVersionId ?? null),
1084
1132
  v(log.rootEntityType ?? null),
1085
1133
  v(log.rootEntityId ?? null),
1086
1134
  v(log.rootEntityName ?? null),
@@ -1175,9 +1223,12 @@ var METRIC_COLUMNS = [
1175
1223
  "entityType",
1176
1224
  "entityId",
1177
1225
  "entityName",
1226
+ "entityVersionId",
1227
+ "parentEntityVersionId",
1178
1228
  "parentEntityType",
1179
1229
  "parentEntityId",
1180
1230
  "parentEntityName",
1231
+ "rootEntityVersionId",
1181
1232
  "rootEntityType",
1182
1233
  "rootEntityId",
1183
1234
  "rootEntityName",
@@ -1275,9 +1326,12 @@ function rowToMetricRecord(row) {
1275
1326
  entityType: row.entityType ?? null,
1276
1327
  entityId: row.entityId ?? null,
1277
1328
  entityName: row.entityName ?? null,
1329
+ entityVersionId: row.entityVersionId ?? null,
1330
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
1278
1331
  parentEntityType: row.parentEntityType ?? null,
1279
1332
  parentEntityId: row.parentEntityId ?? null,
1280
1333
  parentEntityName: row.parentEntityName ?? null,
1334
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
1281
1335
  rootEntityType: row.rootEntityType ?? null,
1282
1336
  rootEntityId: row.rootEntityId ?? null,
1283
1337
  rootEntityName: row.rootEntityName ?? null,
@@ -1315,9 +1369,12 @@ async function batchCreateMetrics(db, args) {
1315
1369
  v(m.entityType ?? null),
1316
1370
  v(m.entityId ?? null),
1317
1371
  v(m.entityName ?? null),
1372
+ v(m.entityVersionId ?? null),
1373
+ v(m.parentEntityVersionId ?? null),
1318
1374
  v(m.parentEntityType ?? null),
1319
1375
  v(m.parentEntityId ?? null),
1320
1376
  v(m.parentEntityName ?? null),
1377
+ v(m.rootEntityVersionId ?? null),
1321
1378
  v(m.rootEntityType ?? null),
1322
1379
  v(m.rootEntityId ?? null),
1323
1380
  v(m.rootEntityName ?? null),
@@ -1651,9 +1708,12 @@ var SCORE_GROUP_BY_COLUMNS = /* @__PURE__ */ new Set([
1651
1708
  "entityType",
1652
1709
  "entityId",
1653
1710
  "entityName",
1711
+ "entityVersionId",
1712
+ "parentEntityVersionId",
1654
1713
  "parentEntityType",
1655
1714
  "parentEntityId",
1656
1715
  "parentEntityName",
1716
+ "rootEntityVersionId",
1657
1717
  "rootEntityType",
1658
1718
  "rootEntityId",
1659
1719
  "rootEntityName",
@@ -1762,9 +1822,12 @@ function rowToScoreRecord(row) {
1762
1822
  entityType: row.entityType ?? null,
1763
1823
  entityId: row.entityId ?? null,
1764
1824
  entityName: row.entityName ?? null,
1825
+ entityVersionId: row.entityVersionId ?? null,
1826
+ parentEntityVersionId: row.parentEntityVersionId ?? null,
1765
1827
  parentEntityType: row.parentEntityType ?? null,
1766
1828
  parentEntityId: row.parentEntityId ?? null,
1767
1829
  parentEntityName: row.parentEntityName ?? null,
1830
+ rootEntityVersionId: row.rootEntityVersionId ?? null,
1768
1831
  rootEntityType: row.rootEntityType ?? null,
1769
1832
  rootEntityId: row.rootEntityId ?? null,
1770
1833
  rootEntityName: row.rootEntityName ?? null,
@@ -1822,7 +1885,7 @@ async function createScore(db, args) {
1822
1885
  await db.execute(
1823
1886
  `INSERT INTO score_events (
1824
1887
  timestamp, traceId, spanId, experimentId, scoreTraceId,
1825
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
1888
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
1826
1889
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
1827
1890
  scorerId, scorerVersion, scoreSource, score, reason, tags, metadata, scope
1828
1891
  )
@@ -1835,9 +1898,12 @@ async function createScore(db, args) {
1835
1898
  v(s.entityType ?? null),
1836
1899
  v(s.entityId ?? null),
1837
1900
  v(s.entityName ?? null),
1901
+ v(s.entityVersionId ?? null),
1902
+ v(s.parentEntityVersionId ?? null),
1838
1903
  v(s.parentEntityType ?? null),
1839
1904
  v(s.parentEntityId ?? null),
1840
1905
  v(s.parentEntityName ?? null),
1906
+ v(s.rootEntityVersionId ?? null),
1841
1907
  v(s.rootEntityType ?? null),
1842
1908
  v(s.rootEntityId ?? null),
1843
1909
  v(s.rootEntityName ?? null),
@@ -1876,9 +1942,12 @@ async function batchCreateScores(db, args) {
1876
1942
  v(legacyScore.entityType ?? null),
1877
1943
  v(legacyScore.entityId ?? null),
1878
1944
  v(legacyScore.entityName ?? null),
1945
+ v(legacyScore.entityVersionId ?? null),
1946
+ v(legacyScore.parentEntityVersionId ?? null),
1879
1947
  v(legacyScore.parentEntityType ?? null),
1880
1948
  v(legacyScore.parentEntityId ?? null),
1881
1949
  v(legacyScore.parentEntityName ?? null),
1950
+ v(legacyScore.rootEntityVersionId ?? null),
1882
1951
  v(legacyScore.rootEntityType ?? null),
1883
1952
  v(legacyScore.rootEntityId ?? null),
1884
1953
  v(legacyScore.rootEntityName ?? null),
@@ -1905,7 +1974,7 @@ async function batchCreateScores(db, args) {
1905
1974
  await db.execute(
1906
1975
  `INSERT INTO score_events (
1907
1976
  timestamp, traceId, spanId, experimentId, scoreTraceId,
1908
- entityType, entityId, entityName, parentEntityType, parentEntityId, parentEntityName, rootEntityType, rootEntityId, rootEntityName,
1977
+ entityType, entityId, entityName, entityVersionId, parentEntityVersionId, parentEntityType, parentEntityId, parentEntityName, rootEntityVersionId, rootEntityType, rootEntityId, rootEntityName,
1909
1978
  userId, organizationId, resourceId, runId, sessionId, threadId, requestId, environment, executionSource, serviceName,
1910
1979
  scorerId, scorerVersion, scoreSource, score, reason, tags, metadata, scope
1911
1980
  )
@@ -2073,6 +2142,7 @@ var COLUMNS2 = [
2073
2142
  "entityType",
2074
2143
  "entityId",
2075
2144
  "entityName",
2145
+ "entityVersionId",
2076
2146
  "userId",
2077
2147
  "organizationId",
2078
2148
  "resourceId",
@@ -2110,6 +2180,7 @@ var SPAN_RECONSTRUCT_SELECT = `
2110
2180
  ${argMaxNonNull("entityType")},
2111
2181
  ${argMaxNonNull("entityId")},
2112
2182
  ${argMaxNonNull("entityName")},
2183
+ ${argMaxNonNull("entityVersionId")},
2113
2184
  ${argMaxNonNull("userId")},
2114
2185
  ${argMaxNonNull("organizationId")},
2115
2186
  ${argMaxNonNull("resourceId")},
@@ -2145,6 +2216,7 @@ function rowToSpanRecord(row) {
2145
2216
  entityType: row.entityType ?? null,
2146
2217
  entityId: row.entityId ?? null,
2147
2218
  entityName: row.entityName ?? null,
2219
+ entityVersionId: row.entityVersionId ?? null,
2148
2220
  userId: row.userId ?? null,
2149
2221
  organizationId: row.organizationId ?? null,
2150
2222
  resourceId: row.resourceId ?? null,
@@ -2188,6 +2260,7 @@ function toValuesTuple(row) {
2188
2260
  v(row.entityType),
2189
2261
  v(row.entityId),
2190
2262
  v(row.entityName),
2263
+ v(row.entityVersionId),
2191
2264
  v(row.userId),
2192
2265
  v(row.organizationId),
2193
2266
  v(row.resourceId),
@@ -2229,6 +2302,7 @@ function createStartSpanRow(s) {
2229
2302
  entityType: s.entityType ?? null,
2230
2303
  entityId: s.entityId ?? null,
2231
2304
  entityName: s.entityName ?? null,
2305
+ entityVersionId: s.entityVersionId ?? null,
2232
2306
  userId: s.userId ?? null,
2233
2307
  organizationId: s.organizationId ?? null,
2234
2308
  resourceId: s.resourceId ?? null,
@@ -2265,6 +2339,7 @@ function createEndSpanRow(s) {
2265
2339
  entityType: s.entityType ?? null,
2266
2340
  entityId: s.entityId ?? null,
2267
2341
  entityName: s.entityName ?? null,
2342
+ entityVersionId: s.entityVersionId ?? null,
2268
2343
  userId: s.userId ?? null,
2269
2344
  organizationId: s.organizationId ?? null,
2270
2345
  resourceId: s.resourceId ?? null,
@@ -2529,5 +2604,5 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
2529
2604
  };
2530
2605
 
2531
2606
  export { ObservabilityStorageDuckDB };
2532
- //# sourceMappingURL=observability-J4YTASAF.js.map
2533
- //# sourceMappingURL=observability-J4YTASAF.js.map
2607
+ //# sourceMappingURL=observability-EMLEGDF7.js.map
2608
+ //# sourceMappingURL=observability-EMLEGDF7.js.map