@mastra/mssql 1.0.0-beta.0 → 1.0.0-beta.10

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.
@@ -1,17 +1,98 @@
1
- import type { MastraMessageContentV2, MastraDBMessage } from '@mastra/core/agent';
2
- import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
3
- import type { StorageThreadType } from '@mastra/core/memory';
4
1
  import { MastraStorage } from '@mastra/core/storage';
5
- export type MastraDBMessageWithTypedContent = Omit<MastraDBMessage, 'content'> & {
6
- content: MastraMessageContentV2;
7
- };
8
- import type { PaginationInfo, StorageColumn, StorageResourceType, TABLE_NAMES, WorkflowRun, WorkflowRuns, StoragePagination, StorageDomains, SpanRecord, TraceRecord, TracesPaginatedArg, UpdateSpanRecord, CreateIndexOptions, IndexInfo, StorageIndexStats, StorageListWorkflowRunsInput } from '@mastra/core/storage';
9
- import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
2
+ import type { StorageDomains, CreateIndexOptions } from '@mastra/core/storage';
10
3
  import sql from 'mssql';
4
+ import { MemoryMSSQL } from './domains/memory/index.js';
5
+ import { ObservabilityMSSQL } from './domains/observability/index.js';
6
+ import { ScoresMSSQL } from './domains/scores/index.js';
7
+ import { WorkflowsMSSQL } from './domains/workflows/index.js';
8
+ export { MemoryMSSQL, ObservabilityMSSQL, ScoresMSSQL, WorkflowsMSSQL };
9
+ export type { MssqlDomainConfig } from './db/index.js';
10
+ /**
11
+ * MSSQL configuration type.
12
+ *
13
+ * Accepts either:
14
+ * - A pre-configured connection pool: `{ id, pool, schemaName? }`
15
+ * - Connection string: `{ id, connectionString, ... }`
16
+ * - Server/port config: `{ id, server, port, database, user, password, ... }`
17
+ */
11
18
  export type MSSQLConfigType = {
12
19
  id: string;
13
20
  schemaName?: string;
21
+ /**
22
+ * When true, automatic initialization (table creation/migrations) is disabled.
23
+ * This is useful for CI/CD pipelines where you want to:
24
+ * 1. Run migrations explicitly during deployment (not at runtime)
25
+ * 2. Use different credentials for schema changes vs runtime operations
26
+ *
27
+ * When disableInit is true:
28
+ * - The storage will not automatically create/alter tables on first use
29
+ * - You must call `storage.init()` explicitly in your CI/CD scripts
30
+ *
31
+ * @example
32
+ * // In CI/CD script:
33
+ * const storage = new MSSQLStore({ ...config, disableInit: false });
34
+ * await storage.init(); // Explicitly run migrations
35
+ *
36
+ * // In runtime application:
37
+ * const storage = new MSSQLStore({ ...config, disableInit: true });
38
+ * // No auto-init, tables must already exist
39
+ */
40
+ disableInit?: boolean;
41
+ /**
42
+ * When true, default indexes will not be created during initialization.
43
+ * This is useful when:
44
+ * 1. You want to manage indexes separately or use custom indexes only
45
+ * 2. Default indexes don't match your query patterns
46
+ * 3. You want to reduce initialization time in development
47
+ *
48
+ * @default false
49
+ */
50
+ skipDefaultIndexes?: boolean;
51
+ /**
52
+ * Custom indexes to create during initialization.
53
+ * These indexes are created in addition to default indexes (unless skipDefaultIndexes is true).
54
+ *
55
+ * Each index must specify which table it belongs to. The store will route each index
56
+ * to the appropriate domain based on the table name.
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * const store = new MSSQLStore({
61
+ * connectionString: '...',
62
+ * indexes: [
63
+ * { name: 'my_threads_type_idx', table: 'mastra_threads', columns: ['JSON_VALUE(metadata, \'$.type\')'] },
64
+ * ],
65
+ * });
66
+ * ```
67
+ */
68
+ indexes?: CreateIndexOptions[];
14
69
  } & ({
70
+ /**
71
+ * Pre-configured mssql ConnectionPool.
72
+ * Use this when you need to configure the pool before initialization,
73
+ * e.g., to add pool listeners or set connection-level settings.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * import sql from 'mssql';
78
+ *
79
+ * const pool = new sql.ConnectionPool({
80
+ * server: 'localhost',
81
+ * database: 'mydb',
82
+ * user: 'user',
83
+ * password: 'password',
84
+ * });
85
+ *
86
+ * // Custom setup before using
87
+ * pool.on('connect', () => {
88
+ * console.log('Pool connected');
89
+ * });
90
+ *
91
+ * const store = new MSSQLStore({ id: 'my-store', pool });
92
+ * ```
93
+ */
94
+ pool: sql.ConnectionPool;
95
+ } | {
15
96
  server: string;
16
97
  port: number;
17
98
  database: string;
@@ -22,6 +103,28 @@ export type MSSQLConfigType = {
22
103
  connectionString: string;
23
104
  });
24
105
  export type MSSQLConfig = MSSQLConfigType;
106
+ /**
107
+ * MSSQL storage adapter for Mastra.
108
+ *
109
+ * Access domain-specific storage via `getStore()`:
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * const storage = new MSSQLStore({ id: 'my-store', connectionString: '...' });
114
+ *
115
+ * // Access memory domain
116
+ * const memory = await storage.getStore('memory');
117
+ * await memory?.saveThread({ thread });
118
+ *
119
+ * // Access workflows domain
120
+ * const workflows = await storage.getStore('workflows');
121
+ * await workflows?.persistWorkflowSnapshot({ workflowName, runId, snapshot });
122
+ *
123
+ * // Access observability domain
124
+ * const observability = await storage.getStore('observability');
125
+ * await observability?.createSpan(span);
126
+ * ```
127
+ */
25
128
  export declare class MSSQLStore extends MastraStorage {
26
129
  pool: sql.ConnectionPool;
27
130
  private schema?;
@@ -30,204 +133,11 @@ export declare class MSSQLStore extends MastraStorage {
30
133
  constructor(config: MSSQLConfigType);
31
134
  init(): Promise<void>;
32
135
  private _performInitializationAndStore;
33
- get supports(): {
34
- selectByIncludeResourceScope: boolean;
35
- resourceWorkingMemory: boolean;
36
- hasColumn: boolean;
37
- createTable: boolean;
38
- deleteMessages: boolean;
39
- listScoresBySpan: boolean;
40
- observabilityInstance: boolean;
41
- indexManagement: boolean;
42
- };
43
- createTable({ tableName, schema, }: {
44
- tableName: TABLE_NAMES;
45
- schema: Record<string, StorageColumn>;
46
- }): Promise<void>;
47
- alterTable({ tableName, schema, ifNotExists, }: {
48
- tableName: TABLE_NAMES;
49
- schema: Record<string, StorageColumn>;
50
- ifNotExists: string[];
51
- }): Promise<void>;
52
- clearTable({ tableName }: {
53
- tableName: TABLE_NAMES;
54
- }): Promise<void>;
55
- dropTable({ tableName }: {
56
- tableName: TABLE_NAMES;
57
- }): Promise<void>;
58
- insert({ tableName, record }: {
59
- tableName: TABLE_NAMES;
60
- record: Record<string, any>;
61
- }): Promise<void>;
62
- batchInsert({ tableName, records }: {
63
- tableName: TABLE_NAMES;
64
- records: Record<string, any>[];
65
- }): Promise<void>;
66
- load<R>({ tableName, keys }: {
67
- tableName: TABLE_NAMES;
68
- keys: Record<string, string>;
69
- }): Promise<R | null>;
70
- /**
71
- * Memory
72
- */
73
- getThreadById({ threadId }: {
74
- threadId: string;
75
- }): Promise<StorageThreadType | null>;
76
- saveThread({ thread }: {
77
- thread: StorageThreadType;
78
- }): Promise<StorageThreadType>;
79
- updateThread({ id, title, metadata, }: {
80
- id: string;
81
- title: string;
82
- metadata: Record<string, unknown>;
83
- }): Promise<StorageThreadType>;
84
- deleteThread({ threadId }: {
85
- threadId: string;
86
- }): Promise<void>;
87
- listMessagesById({ messageIds }: {
88
- messageIds: string[];
89
- }): Promise<{
90
- messages: MastraDBMessage[];
91
- }>;
92
- saveMessages(args: {
93
- messages: MastraDBMessage[];
94
- }): Promise<{
95
- messages: MastraDBMessage[];
96
- }>;
97
- updateMessages({ messages, }: {
98
- messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
99
- id: string;
100
- content?: {
101
- metadata?: MastraMessageContentV2['metadata'];
102
- content?: MastraMessageContentV2['content'];
103
- };
104
- })[];
105
- }): Promise<MastraDBMessage[]>;
106
- deleteMessages(messageIds: string[]): Promise<void>;
107
- getResourceById({ resourceId }: {
108
- resourceId: string;
109
- }): Promise<StorageResourceType | null>;
110
- saveResource({ resource }: {
111
- resource: StorageResourceType;
112
- }): Promise<StorageResourceType>;
113
- updateResource({ resourceId, workingMemory, metadata, }: {
114
- resourceId: string;
115
- workingMemory?: string;
116
- metadata?: Record<string, unknown>;
117
- }): Promise<StorageResourceType>;
118
136
  /**
119
- * Workflows
137
+ * Closes the MSSQL connection pool.
138
+ *
139
+ * This will close the connection pool, including pre-configured pools.
120
140
  */
121
- updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
122
- workflowName: string;
123
- runId: string;
124
- stepId: string;
125
- result: StepResult<any, any, any, any>;
126
- requestContext: Record<string, any>;
127
- }): Promise<Record<string, StepResult<any, any, any, any>>>;
128
- updateWorkflowState({ workflowName, runId, opts, }: {
129
- workflowName: string;
130
- runId: string;
131
- opts: {
132
- status: string;
133
- result?: StepResult<any, any, any, any>;
134
- error?: string;
135
- suspendedPaths?: Record<string, number[]>;
136
- waitingPaths?: Record<string, number[]>;
137
- };
138
- }): Promise<WorkflowRunState | undefined>;
139
- persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot, }: {
140
- workflowName: string;
141
- runId: string;
142
- resourceId?: string;
143
- snapshot: WorkflowRunState;
144
- }): Promise<void>;
145
- loadWorkflowSnapshot({ workflowName, runId, }: {
146
- workflowName: string;
147
- runId: string;
148
- }): Promise<WorkflowRunState | null>;
149
- listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
150
- getWorkflowRunById({ runId, workflowName, }: {
151
- runId: string;
152
- workflowName?: string;
153
- }): Promise<WorkflowRun | null>;
154
141
  close(): Promise<void>;
155
- /**
156
- * Index Management
157
- */
158
- createIndex(options: CreateIndexOptions): Promise<void>;
159
- listIndexes(tableName?: string): Promise<IndexInfo[]>;
160
- describeIndex(indexName: string): Promise<StorageIndexStats>;
161
- dropIndex(indexName: string): Promise<void>;
162
- /**
163
- * Tracing / Observability
164
- */
165
- private getObservabilityStore;
166
- createSpan(span: SpanRecord): Promise<void>;
167
- updateSpan({ spanId, traceId, updates, }: {
168
- spanId: string;
169
- traceId: string;
170
- updates: Partial<UpdateSpanRecord>;
171
- }): Promise<void>;
172
- getTrace(traceId: string): Promise<TraceRecord | null>;
173
- getTracesPaginated(args: TracesPaginatedArg): Promise<{
174
- pagination: PaginationInfo;
175
- spans: SpanRecord[];
176
- }>;
177
- batchCreateSpans(args: {
178
- records: SpanRecord[];
179
- }): Promise<void>;
180
- batchUpdateSpans(args: {
181
- records: {
182
- traceId: string;
183
- spanId: string;
184
- updates: Partial<UpdateSpanRecord>;
185
- }[];
186
- }): Promise<void>;
187
- batchDeleteTraces(args: {
188
- traceIds: string[];
189
- }): Promise<void>;
190
- /**
191
- * Scorers
192
- */
193
- getScoreById({ id: _id }: {
194
- id: string;
195
- }): Promise<ScoreRowData | null>;
196
- listScoresByScorerId({ scorerId: _scorerId, pagination: _pagination, entityId: _entityId, entityType: _entityType, source: _source, }: {
197
- scorerId: string;
198
- pagination: StoragePagination;
199
- entityId?: string;
200
- entityType?: string;
201
- source?: ScoringSource;
202
- }): Promise<{
203
- pagination: PaginationInfo;
204
- scores: ScoreRowData[];
205
- }>;
206
- saveScore(_score: ScoreRowData): Promise<{
207
- score: ScoreRowData;
208
- }>;
209
- listScoresByRunId({ runId: _runId, pagination: _pagination, }: {
210
- runId: string;
211
- pagination: StoragePagination;
212
- }): Promise<{
213
- pagination: PaginationInfo;
214
- scores: ScoreRowData[];
215
- }>;
216
- listScoresByEntityId({ entityId: _entityId, entityType: _entityType, pagination: _pagination, }: {
217
- pagination: StoragePagination;
218
- entityId: string;
219
- entityType: string;
220
- }): Promise<{
221
- pagination: PaginationInfo;
222
- scores: ScoreRowData[];
223
- }>;
224
- listScoresBySpan({ traceId, spanId, pagination: _pagination, }: {
225
- traceId: string;
226
- spanId: string;
227
- pagination: StoragePagination;
228
- }): Promise<{
229
- pagination: PaginationInfo;
230
- scores: ScoreRowData[];
231
- }>;
232
142
  }
233
143
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAA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AAE,kBAAkB,EAAE,CAAC;CAChC,GAAG,CACA;IACE;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;CAC1B,GACD;IACE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC;CACxB,GACD;IACE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CACJ,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAS1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,UAAW,SAAQ,aAAa;IACpC,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,WAAW,CAAiC;IACpD,MAAM,EAAE,cAAc,CAAC;gBAEX,MAAM,EAAE,eAAe;IAmE7B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAqBb,8BAA8B;IAS5C;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mssql",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.10",
4
4
  "description": "MSSQL provider for Mastra - db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,16 +23,17 @@
23
23
  "mssql": "^11.0.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@microsoft/api-extractor": "^7.52.8",
27
26
  "@types/mssql": "^9.1.8",
28
- "@types/node": "^20.19.0",
27
+ "@types/node": "22.13.17",
28
+ "@vitest/coverage-v8": "4.0.12",
29
+ "@vitest/ui": "4.0.12",
29
30
  "eslint": "^9.37.0",
30
31
  "tsup": "^8.5.0",
31
- "typescript": "^5.8.3",
32
- "vitest": "^3.2.4",
33
- "@internal/lint": "0.0.53",
32
+ "typescript": "^5.9.3",
33
+ "vitest": "4.0.16",
34
34
  "@internal/storage-test-utils": "0.0.49",
35
- "@mastra/core": "1.0.0-beta.0",
35
+ "@mastra/core": "1.0.0-beta.20",
36
+ "@internal/lint": "0.0.53",
36
37
  "@internal/types-builder": "0.0.28"
37
38
  },
38
39
  "peerDependencies": {
@@ -55,7 +56,8 @@
55
56
  "node": ">=22.13.0"
56
57
  },
57
58
  "scripts": {
58
- "build": "tsup --silent --config tsup.config.ts",
59
+ "build:lib": "tsup --silent --config tsup.config.ts",
60
+ "build:docs": "pnpx tsx ../../scripts/generate-package-docs.ts stores/mssql",
59
61
  "build:watch": "tsup --watch --silent --config tsup.config.ts",
60
62
  "pretest": "docker compose up -d && (for i in $(seq 1 30); do docker compose ps | grep mssql && break || sleep 1; done) && (for i in $(seq 1 30); do docker inspect --format='{{.State.Health.Status}}' $(docker compose ps -q mssql) | grep healthy && break || sleep 2; done)",
61
63
  "test": "vitest run",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAQhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,GAAG,MAAM,OAAO,CAAC;AAIxB,YAAY,EAAE,kBAAkB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;AAEjE,qBAAa,oBAAqB,SAAQ,eAAe;IAChD,IAAI,EAAE,GAAG,CAAC,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,kBAAkB,CAA8B;IACxD,OAAO,CAAC,mBAAmB,CAAkC;IAE7D,SAAS,CAA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