@mastra/duckdb 1.11.1 → 1.11.2-alpha.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/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-B8uK8pWn.cjs → observability-By0tHYDZ.cjs} +29 -10
- package/dist/{observability-B8uK8pWn.cjs.map → observability-By0tHYDZ.cjs.map} +1 -1
- package/dist/{observability-BVE7R9Oz.js → observability-DPpE45z0.js} +29 -10
- package/dist/{observability-BVE7R9Oz.js.map → observability-DPpE45z0.js.map} +1 -1
- package/dist/storage/domains/observability/tracing.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -550,7 +550,7 @@ var ObservabilityStorageDuckDB = class extends _mastra_core_storage.Observabilit
|
|
|
550
550
|
async loadDelegate() {
|
|
551
551
|
if (this.delegate) return this.delegate;
|
|
552
552
|
if (this.unavailableError) return null;
|
|
553
|
-
if (!this.loadPromise) this.loadPromise = Promise.resolve().then(() => require("./observability-
|
|
553
|
+
if (!this.loadPromise) this.loadPromise = Promise.resolve().then(() => require("./observability-By0tHYDZ.cjs")).then(({ ObservabilityStorageDuckDB }) => {
|
|
554
554
|
const delegate = new ObservabilityStorageDuckDB({ db: this.db });
|
|
555
555
|
this.delegate = delegate;
|
|
556
556
|
return delegate;
|
package/dist/index.js
CHANGED
|
@@ -549,7 +549,7 @@ var ObservabilityStorageDuckDB = class extends ObservabilityStorage {
|
|
|
549
549
|
async loadDelegate() {
|
|
550
550
|
if (this.delegate) return this.delegate;
|
|
551
551
|
if (this.unavailableError) return null;
|
|
552
|
-
if (!this.loadPromise) this.loadPromise = import("./observability-
|
|
552
|
+
if (!this.loadPromise) this.loadPromise = import("./observability-DPpE45z0.js").then(({ ObservabilityStorageDuckDB }) => {
|
|
553
553
|
const delegate = new ObservabilityStorageDuckDB({ db: this.db });
|
|
554
554
|
this.delegate = delegate;
|
|
555
555
|
return delegate;
|
|
@@ -4031,6 +4031,7 @@ async function insertSpanEvents(db, rows) {
|
|
|
4031
4031
|
await db.execute(`INSERT INTO span_events (${COLUMNS_SQL}) VALUES ${tuples}`);
|
|
4032
4032
|
}
|
|
4033
4033
|
function createStartSpanRow(s) {
|
|
4034
|
+
const payloadOnEndRow = !!s.endedAt && !s.isEvent;
|
|
4034
4035
|
return {
|
|
4035
4036
|
eventType: "start",
|
|
4036
4037
|
timestamp: s.startedAt,
|
|
@@ -4058,15 +4059,15 @@ function createStartSpanRow(s) {
|
|
|
4058
4059
|
environment: s.environment ?? null,
|
|
4059
4060
|
source: s.source ?? null,
|
|
4060
4061
|
serviceName: s.serviceName ?? null,
|
|
4061
|
-
attributes: s.attributes ?? null,
|
|
4062
|
-
metadata: s.metadata ?? null,
|
|
4062
|
+
attributes: payloadOnEndRow ? null : s.attributes ?? null,
|
|
4063
|
+
metadata: payloadOnEndRow ? null : s.metadata ?? null,
|
|
4063
4064
|
tags: s.tags == null ? null : normalizeTags(s.tags),
|
|
4064
4065
|
scope: s.scope ?? null,
|
|
4065
4066
|
links: null,
|
|
4066
|
-
input: s.input ?? null,
|
|
4067
|
+
input: payloadOnEndRow ? null : s.input ?? null,
|
|
4067
4068
|
output: null,
|
|
4068
4069
|
error: null,
|
|
4069
|
-
requestContext: s.requestContext ?? null
|
|
4070
|
+
requestContext: payloadOnEndRow ? null : s.requestContext ?? null
|
|
4070
4071
|
};
|
|
4071
4072
|
}
|
|
4072
4073
|
function createEndSpanRow(s) {
|
|
@@ -4226,6 +4227,15 @@ async function listTraceRows(db, args, reconstructSelect, mapRow, toSpans) {
|
|
|
4226
4227
|
`;
|
|
4227
4228
|
const countResult = await db.query(countSql, prefilterParams);
|
|
4228
4229
|
const total = Number(countResult[0]?.total ?? 0);
|
|
4230
|
+
if (total === 0 || offset >= total) return {
|
|
4231
|
+
pagination: {
|
|
4232
|
+
total,
|
|
4233
|
+
page,
|
|
4234
|
+
perPage,
|
|
4235
|
+
hasMore: false
|
|
4236
|
+
},
|
|
4237
|
+
spans: []
|
|
4238
|
+
};
|
|
4229
4239
|
const pageSql = `
|
|
4230
4240
|
WITH page_roots AS (
|
|
4231
4241
|
SELECT traceId, spanId, min(timestamp) AS anchorStartedAt
|
|
@@ -4282,6 +4292,15 @@ async function listTraceRows(db, args, reconstructSelect, mapRow, toSpans) {
|
|
|
4282
4292
|
`;
|
|
4283
4293
|
const countResult = await db.query(countSql, [...prefilterParams, ...postAggParams]);
|
|
4284
4294
|
const total = Number(countResult[0]?.total ?? 0);
|
|
4295
|
+
if (total === 0 || page * perPage >= total) return {
|
|
4296
|
+
pagination: {
|
|
4297
|
+
total,
|
|
4298
|
+
page,
|
|
4299
|
+
perPage,
|
|
4300
|
+
hasMore: false
|
|
4301
|
+
},
|
|
4302
|
+
spans: []
|
|
4303
|
+
};
|
|
4285
4304
|
const dataSql = `
|
|
4286
4305
|
${cteSql},
|
|
4287
4306
|
page_roots AS (
|
|
@@ -4589,9 +4608,9 @@ async function listBranches(db, args) {
|
|
|
4589
4608
|
`;
|
|
4590
4609
|
const countResult = await db.query(countSql, prefilterParams);
|
|
4591
4610
|
const total = Number(countResult[0]?.total ?? 0);
|
|
4592
|
-
if (total === 0) return {
|
|
4611
|
+
if (total === 0 || page * perPage >= total) return {
|
|
4593
4612
|
pagination: {
|
|
4594
|
-
total
|
|
4613
|
+
total,
|
|
4595
4614
|
page,
|
|
4596
4615
|
perPage,
|
|
4597
4616
|
hasMore: false
|
|
@@ -4652,9 +4671,9 @@ async function listBranches(db, args) {
|
|
|
4652
4671
|
`;
|
|
4653
4672
|
const countResult = await db.query(countSql, [...prefilterParams, ...postAggParams]);
|
|
4654
4673
|
const total = Number(countResult[0]?.total ?? 0);
|
|
4655
|
-
if (total === 0) return {
|
|
4674
|
+
if (total === 0 || page * perPage >= total) return {
|
|
4656
4675
|
pagination: {
|
|
4657
|
-
total
|
|
4676
|
+
total,
|
|
4658
4677
|
page,
|
|
4659
4678
|
perPage,
|
|
4660
4679
|
hasMore: false
|
|
@@ -4766,7 +4785,7 @@ async function getBranchDeltaCursor(db, filters) {
|
|
|
4766
4785
|
branch_anchors AS (
|
|
4767
4786
|
SELECT reconstructed.*, candidate_anchors.cursorId AS anchorCursorId
|
|
4768
4787
|
FROM (
|
|
4769
|
-
${
|
|
4788
|
+
${buildPostAggReconstructSelect(postAgg, "startedAt")}
|
|
4770
4789
|
WHERE (traceId, spanId) IN (SELECT traceId, spanId FROM candidate_anchors)
|
|
4771
4790
|
GROUP BY traceId, spanId
|
|
4772
4791
|
) AS reconstructed
|
|
@@ -5087,4 +5106,4 @@ var ObservabilityStorageDuckDB = class ObservabilityStorageDuckDB extends _mastr
|
|
|
5087
5106
|
//#endregion
|
|
5088
5107
|
exports.ObservabilityStorageDuckDB = ObservabilityStorageDuckDB;
|
|
5089
5108
|
|
|
5090
|
-
//# sourceMappingURL=observability-
|
|
5109
|
+
//# sourceMappingURL=observability-By0tHYDZ.cjs.map
|