@mastra/libsql 1.9.0-alpha.1 → 1.9.0-alpha.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/index.js CHANGED
@@ -1359,6 +1359,9 @@ function transformFromSqlRow({
1359
1359
  const dateColumns = new Set(
1360
1360
  Object.keys(TABLE_SCHEMAS[tableName]).filter((key) => TABLE_SCHEMAS[tableName][key].type === "timestamp").map((key) => key)
1361
1361
  );
1362
+ const booleanColumns = new Set(
1363
+ Object.keys(TABLE_SCHEMAS[tableName]).filter((key) => TABLE_SCHEMAS[tableName][key].type === "boolean").map((key) => key)
1364
+ );
1362
1365
  for (const [key, value] of Object.entries(sqlRow)) {
1363
1366
  if (value === null || value === void 0) {
1364
1367
  result[key] = value;
@@ -1372,6 +1375,10 @@ function transformFromSqlRow({
1372
1375
  result[key] = safelyParseJSON(value);
1373
1376
  continue;
1374
1377
  }
1378
+ if (booleanColumns.has(key)) {
1379
+ result[key] = Boolean(value);
1380
+ continue;
1381
+ }
1375
1382
  result[key] = value;
1376
1383
  }
1377
1384
  return result;
@@ -7924,6 +7931,39 @@ var ObservabilityLibSQL = class extends ObservabilityStorage {
7924
7931
  );
7925
7932
  }
7926
7933
  }
7934
+ async getTraceLight(args) {
7935
+ const { traceId } = args;
7936
+ try {
7937
+ const spans = await this.#db.selectMany({
7938
+ tableName: TABLE_SPANS,
7939
+ whereClause: { sql: " WHERE traceId = ?", args: [traceId] },
7940
+ orderBy: "startedAt ASC"
7941
+ });
7942
+ if (!spans || spans.length === 0) {
7943
+ return null;
7944
+ }
7945
+ return {
7946
+ traceId,
7947
+ spans: spans.map((span) => {
7948
+ const transformed = transformFromSqlRow({ tableName: TABLE_SPANS, sqlRow: span });
7949
+ const { input, output, attributes, metadata, tags, links, ...light } = transformed;
7950
+ return light;
7951
+ })
7952
+ };
7953
+ } catch (error) {
7954
+ throw new MastraError(
7955
+ {
7956
+ id: createStorageErrorId("LIBSQL", "GET_TRACE_LIGHT", "FAILED"),
7957
+ domain: ErrorDomain.STORAGE,
7958
+ category: ErrorCategory.USER,
7959
+ details: {
7960
+ traceId
7961
+ }
7962
+ },
7963
+ error
7964
+ );
7965
+ }
7966
+ }
7927
7967
  async updateSpan(args) {
7928
7968
  const { traceId, spanId, updates } = args;
7929
7969
  try {