@mastra/mssql 1.0.0-beta.3 → 1.0.0-beta.4
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 +31 -0
- package/dist/index.cjs +65 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +66 -65
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +20 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @mastra/mssql
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.4
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `disableInit` option to all storage adapters ([#10851](https://github.com/mastra-ai/mastra/pull/10851))
|
|
8
|
+
|
|
9
|
+
Adds a new `disableInit` config option to all storage providers that allows users to disable automatic table creation/migrations at runtime. This is useful for CI/CD pipelines where you want to run migrations during deployment with elevated credentials, then run the application with `disableInit: true` so it doesn't attempt schema changes at runtime.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// CI/CD script - run migrations
|
|
13
|
+
const storage = new PostgresStore({
|
|
14
|
+
connectionString: DATABASE_URL,
|
|
15
|
+
id: 'pg-storage',
|
|
16
|
+
});
|
|
17
|
+
await storage.init();
|
|
18
|
+
|
|
19
|
+
// Runtime - skip auto-init
|
|
20
|
+
const storage = new PostgresStore({
|
|
21
|
+
connectionString: DATABASE_URL,
|
|
22
|
+
id: 'pg-storage',
|
|
23
|
+
disableInit: true,
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Standardize error IDs across all storage and vector stores using centralized helper functions (`createStorageErrorId` and `createVectorErrorId`). This ensures consistent error ID patterns (`MASTRA_STORAGE_{STORE}_{OPERATION}_{STATUS}` and `MASTRA_VECTOR_{STORE}_{OPERATION}_{STATUS}`) across the codebase for better error tracking and debugging. ([#10913](https://github.com/mastra-ai/mastra/pull/10913))
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`85d7ee1`](https://github.com/mastra-ai/mastra/commit/85d7ee18ff4e14d625a8a30ec6656bb49804989b), [`c6c1092`](https://github.com/mastra-ai/mastra/commit/c6c1092f8fbf76109303f69e000e96fd1960c4ce), [`81dc110`](https://github.com/mastra-ai/mastra/commit/81dc11008d147cf5bdc8996ead1aa61dbdebb6fc), [`7aedb74`](https://github.com/mastra-ai/mastra/commit/7aedb74883adf66af38e270e4068fd42e7a37036), [`8f02d80`](https://github.com/mastra-ai/mastra/commit/8f02d800777397e4b45d7f1ad041988a8b0c6630), [`d7aad50`](https://github.com/mastra-ai/mastra/commit/d7aad501ce61646b76b4b511e558ac4eea9884d0), [`ce0a73a`](https://github.com/mastra-ai/mastra/commit/ce0a73abeaa75b10ca38f9e40a255a645d50ebfb), [`a02e542`](https://github.com/mastra-ai/mastra/commit/a02e542d23179bad250b044b17ff023caa61739f), [`a372c64`](https://github.com/mastra-ai/mastra/commit/a372c640ad1fd12e8f0613cebdc682fc156b4d95), [`8846867`](https://github.com/mastra-ai/mastra/commit/8846867ffa9a3746767618e314bebac08eb77d87), [`42a42cf`](https://github.com/mastra-ai/mastra/commit/42a42cf3132b9786feecbb8c13c583dce5b0e198), [`ae08bf0`](https://github.com/mastra-ai/mastra/commit/ae08bf0ebc6a4e4da992b711c4a389c32ba84cf4), [`21735a7`](https://github.com/mastra-ai/mastra/commit/21735a7ef306963554a69a89b44f06c3bcd85141), [`1d877b8`](https://github.com/mastra-ai/mastra/commit/1d877b8d7b536a251c1a7a18db7ddcf4f68d6f8b)]:
|
|
32
|
+
- @mastra/core@1.0.0-beta.7
|
|
33
|
+
|
|
3
34
|
## 1.0.0-beta.3
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -181,7 +181,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
181
181
|
} catch (error$1) {
|
|
182
182
|
throw new error.MastraError(
|
|
183
183
|
{
|
|
184
|
-
id: "
|
|
184
|
+
id: storage.createStorageErrorId("MSSQL", "GET_THREAD_BY_ID", "FAILED"),
|
|
185
185
|
domain: error.ErrorDomain.STORAGE,
|
|
186
186
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
187
187
|
details: {
|
|
@@ -196,7 +196,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
196
196
|
const { resourceId, page = 0, perPage: perPageInput, orderBy } = args;
|
|
197
197
|
if (page < 0) {
|
|
198
198
|
throw new error.MastraError({
|
|
199
|
-
id: "
|
|
199
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
200
200
|
domain: error.ErrorDomain.STORAGE,
|
|
201
201
|
category: error.ErrorCategory.USER,
|
|
202
202
|
text: "Page number must be non-negative",
|
|
@@ -255,7 +255,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
255
255
|
} catch (error$1) {
|
|
256
256
|
const mastraError = new error.MastraError(
|
|
257
257
|
{
|
|
258
|
-
id: "
|
|
258
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
259
259
|
domain: error.ErrorDomain.STORAGE,
|
|
260
260
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
261
261
|
details: {
|
|
@@ -308,7 +308,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
308
308
|
} catch (error$1) {
|
|
309
309
|
throw new error.MastraError(
|
|
310
310
|
{
|
|
311
|
-
id: "
|
|
311
|
+
id: storage.createStorageErrorId("MSSQL", "SAVE_THREAD", "FAILED"),
|
|
312
312
|
domain: error.ErrorDomain.STORAGE,
|
|
313
313
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
314
314
|
details: {
|
|
@@ -330,7 +330,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
330
330
|
const existingThread = await this.getThreadById({ threadId: id });
|
|
331
331
|
if (!existingThread) {
|
|
332
332
|
throw new error.MastraError({
|
|
333
|
-
id: "
|
|
333
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_THREAD", "NOT_FOUND"),
|
|
334
334
|
domain: error.ErrorDomain.STORAGE,
|
|
335
335
|
category: error.ErrorCategory.USER,
|
|
336
336
|
text: `Thread ${id} not found`,
|
|
@@ -365,7 +365,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
365
365
|
}
|
|
366
366
|
if (!thread) {
|
|
367
367
|
throw new error.MastraError({
|
|
368
|
-
id: "
|
|
368
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_THREAD", "NOT_FOUND"),
|
|
369
369
|
domain: error.ErrorDomain.STORAGE,
|
|
370
370
|
category: error.ErrorCategory.USER,
|
|
371
371
|
text: `Thread ${id} not found after update`,
|
|
@@ -384,7 +384,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
384
384
|
} catch (error$1) {
|
|
385
385
|
throw new error.MastraError(
|
|
386
386
|
{
|
|
387
|
-
id: "
|
|
387
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_THREAD", "FAILED"),
|
|
388
388
|
domain: error.ErrorDomain.STORAGE,
|
|
389
389
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
390
390
|
details: {
|
|
@@ -414,7 +414,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
414
414
|
});
|
|
415
415
|
throw new error.MastraError(
|
|
416
416
|
{
|
|
417
|
-
id: "
|
|
417
|
+
id: storage.createStorageErrorId("MSSQL", "DELETE_THREAD", "FAILED"),
|
|
418
418
|
domain: error.ErrorDomain.STORAGE,
|
|
419
419
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
420
420
|
details: {
|
|
@@ -529,7 +529,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
529
529
|
} catch (error$1) {
|
|
530
530
|
const mastraError = new error.MastraError(
|
|
531
531
|
{
|
|
532
|
-
id: "
|
|
532
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
533
533
|
domain: error.ErrorDomain.STORAGE,
|
|
534
534
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
535
535
|
details: {
|
|
@@ -549,7 +549,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
549
549
|
if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
|
|
550
550
|
throw new error.MastraError(
|
|
551
551
|
{
|
|
552
|
-
id: "
|
|
552
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
553
553
|
domain: error.ErrorDomain.STORAGE,
|
|
554
554
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
555
555
|
details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
|
|
@@ -559,7 +559,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
559
559
|
}
|
|
560
560
|
if (page < 0) {
|
|
561
561
|
throw new error.MastraError({
|
|
562
|
-
id: "
|
|
562
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
563
563
|
domain: error.ErrorDomain.STORAGE,
|
|
564
564
|
category: error.ErrorCategory.USER,
|
|
565
565
|
text: "Page number must be non-negative",
|
|
@@ -657,7 +657,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
657
657
|
} catch (error$1) {
|
|
658
658
|
const mastraError = new error.MastraError(
|
|
659
659
|
{
|
|
660
|
-
id: "
|
|
660
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_MESSAGES", "FAILED"),
|
|
661
661
|
domain: error.ErrorDomain.STORAGE,
|
|
662
662
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
663
663
|
details: {
|
|
@@ -683,7 +683,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
683
683
|
const threadId = messages[0]?.threadId;
|
|
684
684
|
if (!threadId) {
|
|
685
685
|
throw new error.MastraError({
|
|
686
|
-
id: "
|
|
686
|
+
id: storage.createStorageErrorId("MSSQL", "SAVE_MESSAGES", "INVALID_THREAD_ID"),
|
|
687
687
|
domain: error.ErrorDomain.STORAGE,
|
|
688
688
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
689
689
|
text: `Thread ID is required`
|
|
@@ -692,7 +692,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
692
692
|
const thread = await this.getThreadById({ threadId });
|
|
693
693
|
if (!thread) {
|
|
694
694
|
throw new error.MastraError({
|
|
695
|
-
id: "
|
|
695
|
+
id: storage.createStorageErrorId("MSSQL", "SAVE_MESSAGES", "THREAD_NOT_FOUND"),
|
|
696
696
|
domain: error.ErrorDomain.STORAGE,
|
|
697
697
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
698
698
|
text: `Thread ${threadId} not found`,
|
|
@@ -765,7 +765,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
765
765
|
} catch (error$1) {
|
|
766
766
|
throw new error.MastraError(
|
|
767
767
|
{
|
|
768
|
-
id: "
|
|
768
|
+
id: storage.createStorageErrorId("MSSQL", "SAVE_MESSAGES", "FAILED"),
|
|
769
769
|
domain: error.ErrorDomain.STORAGE,
|
|
770
770
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
771
771
|
details: { threadId }
|
|
@@ -856,7 +856,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
856
856
|
await transaction.rollback();
|
|
857
857
|
throw new error.MastraError(
|
|
858
858
|
{
|
|
859
|
-
id: "
|
|
859
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_MESSAGES", "FAILED"),
|
|
860
860
|
domain: error.ErrorDomain.STORAGE,
|
|
861
861
|
category: error.ErrorCategory.THIRD_PARTY
|
|
862
862
|
},
|
|
@@ -918,7 +918,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
918
918
|
} catch (error$1) {
|
|
919
919
|
throw new error.MastraError(
|
|
920
920
|
{
|
|
921
|
-
id: "
|
|
921
|
+
id: storage.createStorageErrorId("MSSQL", "DELETE_MESSAGES", "FAILED"),
|
|
922
922
|
domain: error.ErrorDomain.STORAGE,
|
|
923
923
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
924
924
|
details: { messageIds: messageIds.join(", ") }
|
|
@@ -946,7 +946,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
946
946
|
} catch (error$1) {
|
|
947
947
|
const mastraError = new error.MastraError(
|
|
948
948
|
{
|
|
949
|
-
id: "
|
|
949
|
+
id: storage.createStorageErrorId("MSSQL", "GET_RESOURCE_BY_ID", "FAILED"),
|
|
950
950
|
domain: error.ErrorDomain.STORAGE,
|
|
951
951
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
952
952
|
details: { resourceId }
|
|
@@ -1013,7 +1013,7 @@ var MemoryMSSQL = class extends storage.MemoryStorage {
|
|
|
1013
1013
|
} catch (error$1) {
|
|
1014
1014
|
const mastraError = new error.MastraError(
|
|
1015
1015
|
{
|
|
1016
|
-
id: "
|
|
1016
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_RESOURCE", "FAILED"),
|
|
1017
1017
|
domain: error.ErrorDomain.STORAGE,
|
|
1018
1018
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1019
1019
|
details: { resourceId }
|
|
@@ -1060,7 +1060,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1060
1060
|
} catch (error$1) {
|
|
1061
1061
|
throw new error.MastraError(
|
|
1062
1062
|
{
|
|
1063
|
-
id: "
|
|
1063
|
+
id: storage.createStorageErrorId("MSSQL", "CREATE_SPAN", "FAILED"),
|
|
1064
1064
|
domain: error.ErrorDomain.STORAGE,
|
|
1065
1065
|
category: error.ErrorCategory.USER,
|
|
1066
1066
|
details: {
|
|
@@ -1106,7 +1106,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1106
1106
|
} catch (error$1) {
|
|
1107
1107
|
throw new error.MastraError(
|
|
1108
1108
|
{
|
|
1109
|
-
id: "
|
|
1109
|
+
id: storage.createStorageErrorId("MSSQL", "GET_TRACE", "FAILED"),
|
|
1110
1110
|
domain: error.ErrorDomain.STORAGE,
|
|
1111
1111
|
category: error.ErrorCategory.USER,
|
|
1112
1112
|
details: {
|
|
@@ -1138,7 +1138,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1138
1138
|
} catch (error$1) {
|
|
1139
1139
|
throw new error.MastraError(
|
|
1140
1140
|
{
|
|
1141
|
-
id: "
|
|
1141
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_SPAN", "FAILED"),
|
|
1142
1142
|
domain: error.ErrorDomain.STORAGE,
|
|
1143
1143
|
category: error.ErrorCategory.USER,
|
|
1144
1144
|
details: {
|
|
@@ -1175,7 +1175,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1175
1175
|
name = `agent run: '${entityId}'`;
|
|
1176
1176
|
} else {
|
|
1177
1177
|
const error$1 = new error.MastraError({
|
|
1178
|
-
id: "
|
|
1178
|
+
id: storage.createStorageErrorId("MSSQL", "GET_TRACES_PAGINATED", "INVALID_ENTITY_TYPE"),
|
|
1179
1179
|
domain: error.ErrorDomain.STORAGE,
|
|
1180
1180
|
category: error.ErrorCategory.USER,
|
|
1181
1181
|
details: {
|
|
@@ -1244,7 +1244,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1244
1244
|
} catch (error$1) {
|
|
1245
1245
|
throw new error.MastraError(
|
|
1246
1246
|
{
|
|
1247
|
-
id: "
|
|
1247
|
+
id: storage.createStorageErrorId("MSSQL", "GET_TRACES_PAGINATED", "FAILED"),
|
|
1248
1248
|
domain: error.ErrorDomain.STORAGE,
|
|
1249
1249
|
category: error.ErrorCategory.USER
|
|
1250
1250
|
},
|
|
@@ -1268,7 +1268,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1268
1268
|
} catch (error$1) {
|
|
1269
1269
|
throw new error.MastraError(
|
|
1270
1270
|
{
|
|
1271
|
-
id: "
|
|
1271
|
+
id: storage.createStorageErrorId("MSSQL", "BATCH_CREATE_SPANS", "FAILED"),
|
|
1272
1272
|
domain: error.ErrorDomain.STORAGE,
|
|
1273
1273
|
category: error.ErrorCategory.USER,
|
|
1274
1274
|
details: {
|
|
@@ -1304,7 +1304,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1304
1304
|
} catch (error$1) {
|
|
1305
1305
|
throw new error.MastraError(
|
|
1306
1306
|
{
|
|
1307
|
-
id: "
|
|
1307
|
+
id: storage.createStorageErrorId("MSSQL", "BATCH_UPDATE_SPANS", "FAILED"),
|
|
1308
1308
|
domain: error.ErrorDomain.STORAGE,
|
|
1309
1309
|
category: error.ErrorCategory.USER,
|
|
1310
1310
|
details: {
|
|
@@ -1328,7 +1328,7 @@ var ObservabilityMSSQL = class extends storage.ObservabilityStorage {
|
|
|
1328
1328
|
} catch (error$1) {
|
|
1329
1329
|
throw new error.MastraError(
|
|
1330
1330
|
{
|
|
1331
|
-
id: "
|
|
1331
|
+
id: storage.createStorageErrorId("MSSQL", "BATCH_DELETE_TRACES", "FAILED"),
|
|
1332
1332
|
domain: error.ErrorDomain.STORAGE,
|
|
1333
1333
|
category: error.ErrorCategory.USER,
|
|
1334
1334
|
details: {
|
|
@@ -1368,7 +1368,7 @@ var StoreOperationsMSSQL = class extends storage.StoreOperations {
|
|
|
1368
1368
|
return "BIT";
|
|
1369
1369
|
default:
|
|
1370
1370
|
throw new error.MastraError({
|
|
1371
|
-
id: "
|
|
1371
|
+
id: storage.createStorageErrorId("MSSQL", "TYPE", "NOT_SUPPORTED"),
|
|
1372
1372
|
domain: error.ErrorDomain.STORAGE,
|
|
1373
1373
|
category: error.ErrorCategory.THIRD_PARTY
|
|
1374
1374
|
});
|
|
@@ -1454,7 +1454,7 @@ var StoreOperationsMSSQL = class extends storage.StoreOperations {
|
|
|
1454
1454
|
} catch (error$1) {
|
|
1455
1455
|
throw new error.MastraError(
|
|
1456
1456
|
{
|
|
1457
|
-
id: "
|
|
1457
|
+
id: storage.createStorageErrorId("MSSQL", "INSERT", "FAILED"),
|
|
1458
1458
|
domain: error.ErrorDomain.STORAGE,
|
|
1459
1459
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1460
1460
|
details: {
|
|
@@ -1480,7 +1480,7 @@ var StoreOperationsMSSQL = class extends storage.StoreOperations {
|
|
|
1480
1480
|
} catch (error$1) {
|
|
1481
1481
|
throw new error.MastraError(
|
|
1482
1482
|
{
|
|
1483
|
-
id: "
|
|
1483
|
+
id: storage.createStorageErrorId("MSSQL", "CLEAR_TABLE", "FAILED"),
|
|
1484
1484
|
domain: error.ErrorDomain.STORAGE,
|
|
1485
1485
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1486
1486
|
details: {
|
|
@@ -1583,7 +1583,7 @@ ${columns}
|
|
|
1583
1583
|
} catch (error$1) {
|
|
1584
1584
|
throw new error.MastraError(
|
|
1585
1585
|
{
|
|
1586
|
-
id: "
|
|
1586
|
+
id: storage.createStorageErrorId("MSSQL", "CREATE_TABLE", "FAILED"),
|
|
1587
1587
|
domain: error.ErrorDomain.STORAGE,
|
|
1588
1588
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1589
1589
|
details: {
|
|
@@ -1643,7 +1643,7 @@ ${columns}
|
|
|
1643
1643
|
} catch (error$1) {
|
|
1644
1644
|
throw new error.MastraError(
|
|
1645
1645
|
{
|
|
1646
|
-
id: "
|
|
1646
|
+
id: storage.createStorageErrorId("MSSQL", "ALTER_TABLE", "FAILED"),
|
|
1647
1647
|
domain: error.ErrorDomain.STORAGE,
|
|
1648
1648
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1649
1649
|
details: {
|
|
@@ -1684,7 +1684,7 @@ ${columns}
|
|
|
1684
1684
|
} catch (error$1) {
|
|
1685
1685
|
throw new error.MastraError(
|
|
1686
1686
|
{
|
|
1687
|
-
id: "
|
|
1687
|
+
id: storage.createStorageErrorId("MSSQL", "LOAD", "FAILED"),
|
|
1688
1688
|
domain: error.ErrorDomain.STORAGE,
|
|
1689
1689
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1690
1690
|
details: {
|
|
@@ -1707,7 +1707,7 @@ ${columns}
|
|
|
1707
1707
|
await transaction.rollback();
|
|
1708
1708
|
throw new error.MastraError(
|
|
1709
1709
|
{
|
|
1710
|
-
id: "
|
|
1710
|
+
id: storage.createStorageErrorId("MSSQL", "BATCH_INSERT", "FAILED"),
|
|
1711
1711
|
domain: error.ErrorDomain.STORAGE,
|
|
1712
1712
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1713
1713
|
details: {
|
|
@@ -1726,7 +1726,7 @@ ${columns}
|
|
|
1726
1726
|
} catch (error$1) {
|
|
1727
1727
|
throw new error.MastraError(
|
|
1728
1728
|
{
|
|
1729
|
-
id: "
|
|
1729
|
+
id: storage.createStorageErrorId("MSSQL", "DROP_TABLE", "FAILED"),
|
|
1730
1730
|
domain: error.ErrorDomain.STORAGE,
|
|
1731
1731
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1732
1732
|
details: {
|
|
@@ -1812,7 +1812,7 @@ ${columns}
|
|
|
1812
1812
|
try {
|
|
1813
1813
|
if (!data || Object.keys(data).length === 0) {
|
|
1814
1814
|
throw new error.MastraError({
|
|
1815
|
-
id: "
|
|
1815
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE", "EMPTY_DATA"),
|
|
1816
1816
|
domain: error.ErrorDomain.STORAGE,
|
|
1817
1817
|
category: error.ErrorCategory.USER,
|
|
1818
1818
|
text: "Cannot update with empty data payload"
|
|
@@ -1820,7 +1820,7 @@ ${columns}
|
|
|
1820
1820
|
}
|
|
1821
1821
|
if (!keys || Object.keys(keys).length === 0) {
|
|
1822
1822
|
throw new error.MastraError({
|
|
1823
|
-
id: "
|
|
1823
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE", "EMPTY_KEYS"),
|
|
1824
1824
|
domain: error.ErrorDomain.STORAGE,
|
|
1825
1825
|
category: error.ErrorCategory.USER,
|
|
1826
1826
|
text: "Cannot update without keys to identify records"
|
|
@@ -1861,7 +1861,7 @@ ${columns}
|
|
|
1861
1861
|
} catch (error$1) {
|
|
1862
1862
|
throw new error.MastraError(
|
|
1863
1863
|
{
|
|
1864
|
-
id: "
|
|
1864
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE", "FAILED"),
|
|
1865
1865
|
domain: error.ErrorDomain.STORAGE,
|
|
1866
1866
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1867
1867
|
details: {
|
|
@@ -1890,7 +1890,7 @@ ${columns}
|
|
|
1890
1890
|
await transaction.rollback();
|
|
1891
1891
|
throw new error.MastraError(
|
|
1892
1892
|
{
|
|
1893
|
-
id: "
|
|
1893
|
+
id: storage.createStorageErrorId("MSSQL", "BATCH_UPDATE", "FAILED"),
|
|
1894
1894
|
domain: error.ErrorDomain.STORAGE,
|
|
1895
1895
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1896
1896
|
details: {
|
|
@@ -1939,7 +1939,7 @@ ${columns}
|
|
|
1939
1939
|
await transaction.rollback();
|
|
1940
1940
|
throw new error.MastraError(
|
|
1941
1941
|
{
|
|
1942
|
-
id: "
|
|
1942
|
+
id: storage.createStorageErrorId("MSSQL", "BATCH_DELETE", "FAILED"),
|
|
1943
1943
|
domain: error.ErrorDomain.STORAGE,
|
|
1944
1944
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1945
1945
|
details: {
|
|
@@ -1996,7 +1996,7 @@ ${columns}
|
|
|
1996
1996
|
} catch (error$1) {
|
|
1997
1997
|
throw new error.MastraError(
|
|
1998
1998
|
{
|
|
1999
|
-
id: "
|
|
1999
|
+
id: storage.createStorageErrorId("MSSQL", "INDEX_CREATE", "FAILED"),
|
|
2000
2000
|
domain: error.ErrorDomain.STORAGE,
|
|
2001
2001
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2002
2002
|
details: {
|
|
@@ -2032,7 +2032,7 @@ ${columns}
|
|
|
2032
2032
|
if (result.recordset.length > 1) {
|
|
2033
2033
|
const tables = result.recordset.map((r) => r.table_name).join(", ");
|
|
2034
2034
|
throw new error.MastraError({
|
|
2035
|
-
id: "
|
|
2035
|
+
id: storage.createStorageErrorId("MSSQL", "INDEX", "AMBIGUOUS"),
|
|
2036
2036
|
domain: error.ErrorDomain.STORAGE,
|
|
2037
2037
|
category: error.ErrorCategory.USER,
|
|
2038
2038
|
text: `Index "${indexNameSafe}" exists on multiple tables (${tables}) in schema "${schemaName}". Please drop indexes manually or ensure unique index names.`
|
|
@@ -2048,7 +2048,7 @@ ${columns}
|
|
|
2048
2048
|
} catch (error$1) {
|
|
2049
2049
|
throw new error.MastraError(
|
|
2050
2050
|
{
|
|
2051
|
-
id: "
|
|
2051
|
+
id: storage.createStorageErrorId("MSSQL", "INDEX_DROP", "FAILED"),
|
|
2052
2052
|
domain: error.ErrorDomain.STORAGE,
|
|
2053
2053
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2054
2054
|
details: {
|
|
@@ -2132,7 +2132,7 @@ ${columns}
|
|
|
2132
2132
|
} catch (error$1) {
|
|
2133
2133
|
throw new error.MastraError(
|
|
2134
2134
|
{
|
|
2135
|
-
id: "
|
|
2135
|
+
id: storage.createStorageErrorId("MSSQL", "INDEX_LIST", "FAILED"),
|
|
2136
2136
|
domain: error.ErrorDomain.STORAGE,
|
|
2137
2137
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2138
2138
|
details: tableName ? {
|
|
@@ -2205,7 +2205,7 @@ ${columns}
|
|
|
2205
2205
|
} catch (error$1) {
|
|
2206
2206
|
throw new error.MastraError(
|
|
2207
2207
|
{
|
|
2208
|
-
id: "
|
|
2208
|
+
id: storage.createStorageErrorId("MSSQL", "INDEX_DESCRIBE", "FAILED"),
|
|
2209
2209
|
domain: error.ErrorDomain.STORAGE,
|
|
2210
2210
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2211
2211
|
details: {
|
|
@@ -2286,7 +2286,7 @@ ${columns}
|
|
|
2286
2286
|
} catch (error$1) {
|
|
2287
2287
|
throw new error.MastraError(
|
|
2288
2288
|
{
|
|
2289
|
-
id: "
|
|
2289
|
+
id: storage.createStorageErrorId("MSSQL", "CREATE_PERFORMANCE_INDEXES", "FAILED"),
|
|
2290
2290
|
domain: error.ErrorDomain.STORAGE,
|
|
2291
2291
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2292
2292
|
},
|
|
@@ -2328,7 +2328,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2328
2328
|
} catch (error$1) {
|
|
2329
2329
|
throw new error.MastraError(
|
|
2330
2330
|
{
|
|
2331
|
-
id: "
|
|
2331
|
+
id: storage.createStorageErrorId("MSSQL", "GET_SCORE_BY_ID", "FAILED"),
|
|
2332
2332
|
domain: error.ErrorDomain.STORAGE,
|
|
2333
2333
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2334
2334
|
details: { id }
|
|
@@ -2344,7 +2344,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2344
2344
|
} catch (error$1) {
|
|
2345
2345
|
throw new error.MastraError(
|
|
2346
2346
|
{
|
|
2347
|
-
id: "
|
|
2347
|
+
id: storage.createStorageErrorId("MSSQL", "SAVE_SCORE", "VALIDATION_FAILED"),
|
|
2348
2348
|
domain: error.ErrorDomain.STORAGE,
|
|
2349
2349
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2350
2350
|
},
|
|
@@ -2388,7 +2388,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2388
2388
|
} catch (error$1) {
|
|
2389
2389
|
throw new error.MastraError(
|
|
2390
2390
|
{
|
|
2391
|
-
id: "
|
|
2391
|
+
id: storage.createStorageErrorId("MSSQL", "SAVE_SCORE", "FAILED"),
|
|
2392
2392
|
domain: error.ErrorDomain.STORAGE,
|
|
2393
2393
|
category: error.ErrorCategory.THIRD_PARTY
|
|
2394
2394
|
},
|
|
@@ -2466,7 +2466,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2466
2466
|
} catch (error$1) {
|
|
2467
2467
|
throw new error.MastraError(
|
|
2468
2468
|
{
|
|
2469
|
-
id: "
|
|
2469
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
2470
2470
|
domain: error.ErrorDomain.STORAGE,
|
|
2471
2471
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2472
2472
|
details: { scorerId }
|
|
@@ -2521,7 +2521,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2521
2521
|
} catch (error$1) {
|
|
2522
2522
|
throw new error.MastraError(
|
|
2523
2523
|
{
|
|
2524
|
-
id: "
|
|
2524
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
2525
2525
|
domain: error.ErrorDomain.STORAGE,
|
|
2526
2526
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2527
2527
|
details: { runId }
|
|
@@ -2579,7 +2579,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2579
2579
|
} catch (error$1) {
|
|
2580
2580
|
throw new error.MastraError(
|
|
2581
2581
|
{
|
|
2582
|
-
id: "
|
|
2582
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
2583
2583
|
domain: error.ErrorDomain.STORAGE,
|
|
2584
2584
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2585
2585
|
details: { entityId, entityType }
|
|
@@ -2637,7 +2637,7 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
|
|
|
2637
2637
|
} catch (error$1) {
|
|
2638
2638
|
throw new error.MastraError(
|
|
2639
2639
|
{
|
|
2640
|
-
id: "
|
|
2640
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
2641
2641
|
domain: error.ErrorDomain.STORAGE,
|
|
2642
2642
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2643
2643
|
details: { traceId, spanId }
|
|
@@ -2741,7 +2741,7 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
2741
2741
|
}
|
|
2742
2742
|
throw new error.MastraError(
|
|
2743
2743
|
{
|
|
2744
|
-
id: "
|
|
2744
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_WORKFLOW_RESULTS", "FAILED"),
|
|
2745
2745
|
domain: error.ErrorDomain.STORAGE,
|
|
2746
2746
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2747
2747
|
details: {
|
|
@@ -2779,7 +2779,7 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
2779
2779
|
await transaction.rollback();
|
|
2780
2780
|
throw new error.MastraError(
|
|
2781
2781
|
{
|
|
2782
|
-
id: "
|
|
2782
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_WORKFLOW_STATE", "SNAPSHOT_NOT_FOUND"),
|
|
2783
2783
|
domain: error.ErrorDomain.STORAGE,
|
|
2784
2784
|
category: error.ErrorCategory.SYSTEM,
|
|
2785
2785
|
details: {
|
|
@@ -2806,9 +2806,10 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
2806
2806
|
await transaction.rollback();
|
|
2807
2807
|
} catch {
|
|
2808
2808
|
}
|
|
2809
|
+
if (error$1 instanceof error.MastraError) throw error$1;
|
|
2809
2810
|
throw new error.MastraError(
|
|
2810
2811
|
{
|
|
2811
|
-
id: "
|
|
2812
|
+
id: storage.createStorageErrorId("MSSQL", "UPDATE_WORKFLOW_STATE", "FAILED"),
|
|
2812
2813
|
domain: error.ErrorDomain.STORAGE,
|
|
2813
2814
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2814
2815
|
details: {
|
|
@@ -2849,7 +2850,7 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
2849
2850
|
} catch (error$1) {
|
|
2850
2851
|
throw new error.MastraError(
|
|
2851
2852
|
{
|
|
2852
|
-
id: "
|
|
2853
|
+
id: storage.createStorageErrorId("MSSQL", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
2853
2854
|
domain: error.ErrorDomain.STORAGE,
|
|
2854
2855
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2855
2856
|
details: {
|
|
@@ -2880,7 +2881,7 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
2880
2881
|
} catch (error$1) {
|
|
2881
2882
|
throw new error.MastraError(
|
|
2882
2883
|
{
|
|
2883
|
-
id: "
|
|
2884
|
+
id: storage.createStorageErrorId("MSSQL", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
2884
2885
|
domain: error.ErrorDomain.STORAGE,
|
|
2885
2886
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2886
2887
|
details: {
|
|
@@ -2920,7 +2921,7 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
2920
2921
|
} catch (error$1) {
|
|
2921
2922
|
throw new error.MastraError(
|
|
2922
2923
|
{
|
|
2923
|
-
id: "
|
|
2924
|
+
id: storage.createStorageErrorId("MSSQL", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
2924
2925
|
domain: error.ErrorDomain.STORAGE,
|
|
2925
2926
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2926
2927
|
details: {
|
|
@@ -3000,7 +3001,7 @@ var WorkflowsMSSQL = class extends storage.WorkflowsStorage {
|
|
|
3000
3001
|
} catch (error$1) {
|
|
3001
3002
|
throw new error.MastraError(
|
|
3002
3003
|
{
|
|
3003
|
-
id: "
|
|
3004
|
+
id: storage.createStorageErrorId("MSSQL", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
3004
3005
|
domain: error.ErrorDomain.STORAGE,
|
|
3005
3006
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
3006
3007
|
details: {
|
|
@@ -3023,7 +3024,7 @@ var MSSQLStore = class extends storage.MastraStorage {
|
|
|
3023
3024
|
if (!config.id || typeof config.id !== "string" || config.id.trim() === "") {
|
|
3024
3025
|
throw new Error("MSSQLStore: id must be provided and cannot be empty.");
|
|
3025
3026
|
}
|
|
3026
|
-
super({ id: config.id, name: "MSSQLStore" });
|
|
3027
|
+
super({ id: config.id, name: "MSSQLStore", disableInit: config.disableInit });
|
|
3027
3028
|
try {
|
|
3028
3029
|
if ("connectionString" in config) {
|
|
3029
3030
|
if (!config.connectionString || typeof config.connectionString !== "string" || config.connectionString.trim() === "") {
|
|
@@ -3061,7 +3062,7 @@ var MSSQLStore = class extends storage.MastraStorage {
|
|
|
3061
3062
|
} catch (e) {
|
|
3062
3063
|
throw new error.MastraError(
|
|
3063
3064
|
{
|
|
3064
|
-
id: "
|
|
3065
|
+
id: storage.createStorageErrorId("MSSQL", "INITIALIZATION", "FAILED"),
|
|
3065
3066
|
domain: error.ErrorDomain.STORAGE,
|
|
3066
3067
|
category: error.ErrorCategory.USER
|
|
3067
3068
|
},
|
|
@@ -3085,7 +3086,7 @@ var MSSQLStore = class extends storage.MastraStorage {
|
|
|
3085
3086
|
this.isConnected = null;
|
|
3086
3087
|
throw new error.MastraError(
|
|
3087
3088
|
{
|
|
3088
|
-
id: "
|
|
3089
|
+
id: storage.createStorageErrorId("MSSQL", "INIT", "FAILED"),
|
|
3089
3090
|
domain: error.ErrorDomain.STORAGE,
|
|
3090
3091
|
category: error.ErrorCategory.THIRD_PARTY
|
|
3091
3092
|
},
|
|
@@ -3253,7 +3254,7 @@ var MSSQLStore = class extends storage.MastraStorage {
|
|
|
3253
3254
|
getObservabilityStore() {
|
|
3254
3255
|
if (!this.stores.observability) {
|
|
3255
3256
|
throw new error.MastraError({
|
|
3256
|
-
id: "
|
|
3257
|
+
id: storage.createStorageErrorId("MSSQL", "OBSERVABILITY", "NOT_INITIALIZED"),
|
|
3257
3258
|
domain: error.ErrorDomain.STORAGE,
|
|
3258
3259
|
category: error.ErrorCategory.SYSTEM,
|
|
3259
3260
|
text: "Observability storage is not initialized"
|