@mastra/mssql 0.0.0-sidebar-window-undefined-fix-20251029233656 → 0.0.0-span-scorring-test-20251124132129
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/CHANGELOG.md +516 -4
- package/README.md +28 -20
- package/dist/index.cjs +365 -507
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +364 -506
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +14 -43
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +16 -16
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +5 -5
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +5 -11
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +37 -84
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +12 -7
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -20
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ MSSQLStore supports multiple connection methods:
|
|
|
27
27
|
import { MSSQLStore } from '@mastra/mssql';
|
|
28
28
|
|
|
29
29
|
const store = new MSSQLStore({
|
|
30
|
+
id: 'mssql-storage',
|
|
30
31
|
connectionString:
|
|
31
32
|
'Server=localhost,1433;Database=mastra;User Id=sa;Password=yourPassword;Encrypt=true;TrustServerCertificate=true',
|
|
32
33
|
});
|
|
@@ -36,6 +37,7 @@ const store = new MSSQLStore({
|
|
|
36
37
|
|
|
37
38
|
```typescript
|
|
38
39
|
const store = new MSSQLStore({
|
|
40
|
+
id: 'mssql-storage',
|
|
39
41
|
server: 'localhost',
|
|
40
42
|
port: 1433,
|
|
41
43
|
database: 'mastra',
|
|
@@ -49,6 +51,7 @@ const store = new MSSQLStore({
|
|
|
49
51
|
|
|
50
52
|
```typescript
|
|
51
53
|
const store = new MSSQLStore({
|
|
54
|
+
id: 'mssql-storage',
|
|
52
55
|
connectionString:
|
|
53
56
|
'Server=localhost,1433;Database=mastra;User Id=sa;Password=yourPassword;Encrypt=true;TrustServerCertificate=true',
|
|
54
57
|
schemaName: 'custom_schema', // Use custom schema (default: dbo)
|
|
@@ -98,11 +101,15 @@ await store.saveMessages({
|
|
|
98
101
|
|
|
99
102
|
// Query threads and messages
|
|
100
103
|
const savedThread = await store.getThreadById({ threadId: 'thread-123' });
|
|
101
|
-
const messages = await store.
|
|
104
|
+
const messages = await store.listMessages({ threadId: 'thread-123' });
|
|
102
105
|
```
|
|
103
106
|
|
|
104
107
|
## Configuration
|
|
105
108
|
|
|
109
|
+
### Identifier
|
|
110
|
+
|
|
111
|
+
- `id`: Unique identifier for this store instance (required)
|
|
112
|
+
|
|
106
113
|
### Connection Methods
|
|
107
114
|
|
|
108
115
|
MSSQLStore supports multiple connection methods:
|
|
@@ -111,6 +118,7 @@ MSSQLStore supports multiple connection methods:
|
|
|
111
118
|
|
|
112
119
|
```typescript
|
|
113
120
|
{
|
|
121
|
+
id: 'mssql-storage',
|
|
114
122
|
connectionString: 'Server=localhost,1433;Database=mastra;User Id=sa;Password=yourPassword;Encrypt=true;TrustServerCertificate=true';
|
|
115
123
|
}
|
|
116
124
|
```
|
|
@@ -118,6 +126,7 @@ MSSQLStore supports multiple connection methods:
|
|
|
118
126
|
2. **Server/Port/Database**
|
|
119
127
|
```typescript
|
|
120
128
|
{
|
|
129
|
+
id: 'mssql-storage',
|
|
121
130
|
server: 'localhost',
|
|
122
131
|
port: 1433,
|
|
123
132
|
database: 'mastra',
|
|
@@ -161,7 +170,7 @@ MSSQLStore supports multiple connection methods:
|
|
|
161
170
|
- Rich metadata support
|
|
162
171
|
- Update working memory and metadata independently
|
|
163
172
|
|
|
164
|
-
- **
|
|
173
|
+
- **Tracing & Observability**
|
|
165
174
|
- Trace AI agent execution with spans
|
|
166
175
|
- Query traces with pagination and filtering
|
|
167
176
|
- Batch operations for high-volume tracing
|
|
@@ -209,14 +218,13 @@ MSSQLStore supports multiple connection methods:
|
|
|
209
218
|
- `getThreadById({ threadId })`: Get a thread by ID
|
|
210
219
|
- `updateThread({ id, title, metadata })`: Update thread title and metadata
|
|
211
220
|
- `deleteThread({ threadId })`: Delete a thread and its messages
|
|
212
|
-
- `
|
|
221
|
+
- `listThreadsByResourceId({ resourceId, offset, limit, orderBy? })`: List paginated threads for a resource
|
|
213
222
|
|
|
214
223
|
### Messages
|
|
215
224
|
|
|
216
|
-
- `saveMessages({ messages
|
|
217
|
-
- `
|
|
218
|
-
- `
|
|
219
|
-
- `getMessagesPaginated({ threadId, format?, page?, perPage? })`: Get paginated messages for a thread
|
|
225
|
+
- `saveMessages({ messages })`: Save multiple messages with atomic transaction
|
|
226
|
+
- `listMessagesById({ messageIds })`: Get messages by their IDs
|
|
227
|
+
- `listMessages({ threadId, resourceId?, page?, perPage?, orderBy?, filter? })`: Get paginated messages for a thread with filtering and sorting
|
|
220
228
|
- `updateMessages({ messages })`: Update existing messages with atomic transaction
|
|
221
229
|
- `deleteMessages(messageIds)`: Delete specific messages with atomic transaction
|
|
222
230
|
|
|
@@ -226,15 +234,15 @@ MSSQLStore supports multiple connection methods:
|
|
|
226
234
|
- `getResourceById({ resourceId })`: Get a resource by ID
|
|
227
235
|
- `updateResource({ resourceId, workingMemory?, metadata? })`: Update resource working memory and metadata
|
|
228
236
|
|
|
229
|
-
###
|
|
237
|
+
### Tracing & Observability
|
|
230
238
|
|
|
231
|
-
- `
|
|
232
|
-
- `
|
|
233
|
-
- `
|
|
234
|
-
- `
|
|
235
|
-
- `
|
|
236
|
-
- `
|
|
237
|
-
- `
|
|
239
|
+
- `createSpan(span)`: Create a trace span
|
|
240
|
+
- `updateSpan({ spanId, traceId, updates })`: Update an existing span
|
|
241
|
+
- `getTrace(traceId)`: Get complete trace with all spans
|
|
242
|
+
- `getTracesPaginated({ filters?, pagination? })`: Query traces with pagination and filters
|
|
243
|
+
- `batchCreateSpans({ records })`: Batch create multiple spans
|
|
244
|
+
- `batchUpdateSpans({ records })`: Batch update multiple spans
|
|
245
|
+
- `batchDeleteTraces({ traceIds })`: Batch delete traces
|
|
238
246
|
|
|
239
247
|
### Index Management
|
|
240
248
|
|
|
@@ -249,17 +257,17 @@ MSSQLStore supports multiple connection methods:
|
|
|
249
257
|
- `loadWorkflowSnapshot({ workflowName, runId })`: Load workflow execution state
|
|
250
258
|
- `updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext })`: Update step results (transaction + row locking)
|
|
251
259
|
- `updateWorkflowState({ workflowName, runId, opts })`: Update workflow run status (transaction + row locking)
|
|
252
|
-
- `
|
|
260
|
+
- `listWorkflowRuns({ workflowName?, fromDate?, toDate?, limit?, offset?, resourceId? })`: Query workflow runs
|
|
253
261
|
- `getWorkflowRunById({ runId, workflowName? })`: Get specific workflow run
|
|
254
262
|
|
|
255
263
|
### Scores & Evaluation
|
|
256
264
|
|
|
257
265
|
- `saveScore(score)`: Save evaluation score
|
|
258
266
|
- `getScoreById({ id })`: Get score by ID
|
|
259
|
-
- `
|
|
260
|
-
- `
|
|
261
|
-
- `
|
|
262
|
-
- `
|
|
267
|
+
- `listScoresByScorerId({ scorerId, pagination, entityId?, entityType?, source? })`: Get scores by scorer
|
|
268
|
+
- `listScoresByRunId({ runId, pagination })`: Get scores for a run
|
|
269
|
+
- `listScoresByEntityId({ entityId, entityType, pagination })`: Get scores for an entity
|
|
270
|
+
- `listScoresBySpan({ traceId, spanId, pagination })`: Get scores for a trace span
|
|
263
271
|
|
|
264
272
|
### Traces (Legacy)
|
|
265
273
|
|