@mastra/mssql 0.0.0-fix-local-pkg-cwd-20251226155239 → 0.0.0-fix-11640-persist-workflow-events-to-memory-20260106220027

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
@@ -1,5 +1,5 @@
1
1
  import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
2
- import { MastraStorage, createStorageErrorId, ScoresStorage, TABLE_SCORERS, TABLE_SCHEMAS, normalizePerPage, calculatePagination, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, MemoryStorage, TABLE_THREADS, TABLE_MESSAGES, TABLE_RESOURCES, ObservabilityStorage, TABLE_SPANS, SPAN_SCHEMA, listTracesArgsSchema, getDefaultValue, transformScoreRow as transformScoreRow$1, TraceStatus } from '@mastra/core/storage';
2
+ import { MemoryStorage, TABLE_THREADS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCHEMAS, createStorageErrorId, normalizePerPage, calculatePagination, ObservabilityStorage, TABLE_SPANS, SPAN_SCHEMA, listTracesArgsSchema, ScoresStorage, TABLE_SCORERS, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, MastraStorage, TraceStatus, getDefaultValue, transformScoreRow as transformScoreRow$1 } from '@mastra/core/storage';
3
3
  import sql from 'mssql';
4
4
  import { MessageList } from '@mastra/core/agent';
5
5
  import { MastraBase } from '@mastra/core/base';
@@ -1010,10 +1010,12 @@ function getTableName2({ indexName, schemaName }) {
1010
1010
  function buildDateRangeFilter(dateRange, fieldName) {
1011
1011
  const filters = {};
1012
1012
  if (dateRange?.start) {
1013
- filters[`${fieldName}_gte`] = dateRange.start;
1013
+ const suffix = dateRange.startExclusive ? "_gt" : "_gte";
1014
+ filters[`${fieldName}${suffix}`] = dateRange.start;
1014
1015
  }
1015
1016
  if (dateRange?.end) {
1016
- filters[`${fieldName}_lte`] = dateRange.end;
1017
+ const suffix = dateRange.endExclusive ? "_lt" : "_lte";
1018
+ filters[`${fieldName}${suffix}`] = dateRange.end;
1017
1019
  }
1018
1020
  return filters;
1019
1021
  }
@@ -1031,11 +1033,21 @@ function prepareWhereClause(filters, _schema) {
1031
1033
  const fieldName = key.slice(0, -4);
1032
1034
  conditions.push(`[${parseSqlIdentifier(fieldName, "field name")}] >= @${paramName}`);
1033
1035
  params[paramName] = value instanceof Date ? value.toISOString() : value;
1036
+ } else if (key.endsWith("_gt")) {
1037
+ const paramName = `p${paramIndex++}`;
1038
+ const fieldName = key.slice(0, -3);
1039
+ conditions.push(`[${parseSqlIdentifier(fieldName, "field name")}] > @${paramName}`);
1040
+ params[paramName] = value instanceof Date ? value.toISOString() : value;
1034
1041
  } else if (key.endsWith("_lte")) {
1035
1042
  const paramName = `p${paramIndex++}`;
1036
1043
  const fieldName = key.slice(0, -4);
1037
1044
  conditions.push(`[${parseSqlIdentifier(fieldName, "field name")}] <= @${paramName}`);
1038
1045
  params[paramName] = value instanceof Date ? value.toISOString() : value;
1046
+ } else if (key.endsWith("_lt")) {
1047
+ const paramName = `p${paramIndex++}`;
1048
+ const fieldName = key.slice(0, -3);
1049
+ conditions.push(`[${parseSqlIdentifier(fieldName, "field name")}] < @${paramName}`);
1050
+ params[paramName] = value instanceof Date ? value.toISOString() : value;
1039
1051
  } else if (value === null) {
1040
1052
  conditions.push(`[${parseSqlIdentifier(key, "field name")}] IS NULL`);
1041
1053
  } else if (isInOperator(value)) {
@@ -3684,19 +3696,6 @@ var MSSQLStore = class extends MastraStorage {
3684
3696
  throw err;
3685
3697
  }
3686
3698
  }
3687
- get supports() {
3688
- return {
3689
- selectByIncludeResourceScope: true,
3690
- resourceWorkingMemory: true,
3691
- hasColumn: true,
3692
- createTable: true,
3693
- deleteMessages: true,
3694
- observability: true,
3695
- indexManagement: true,
3696
- listScoresBySpan: true,
3697
- agents: false
3698
- };
3699
- }
3700
3699
  /**
3701
3700
  * Closes the MSSQL connection pool.
3702
3701
  *
@@ -3707,6 +3706,6 @@ var MSSQLStore = class extends MastraStorage {
3707
3706
  }
3708
3707
  };
3709
3708
 
3710
- export { MSSQLStore };
3709
+ export { MSSQLStore, MemoryMSSQL, ObservabilityMSSQL, ScoresMSSQL, WorkflowsMSSQL };
3711
3710
  //# sourceMappingURL=index.js.map
3712
3711
  //# sourceMappingURL=index.js.map