@mastra/mssql 0.4.0 → 0.4.1-alpha.0
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 +9 -0
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +2 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1890,6 +1890,7 @@ var WorkflowsMSSQL = class extends WorkflowsStorage {
|
|
|
1890
1890
|
async persistWorkflowSnapshot({
|
|
1891
1891
|
workflowName,
|
|
1892
1892
|
runId,
|
|
1893
|
+
resourceId,
|
|
1893
1894
|
snapshot
|
|
1894
1895
|
}) {
|
|
1895
1896
|
const table = getTableName({ indexName: TABLE_WORKFLOW_SNAPSHOT, schemaName: getSchemaName(this.schema) });
|
|
@@ -1898,6 +1899,7 @@ var WorkflowsMSSQL = class extends WorkflowsStorage {
|
|
|
1898
1899
|
const request = this.pool.request();
|
|
1899
1900
|
request.input("workflow_name", workflowName);
|
|
1900
1901
|
request.input("run_id", runId);
|
|
1902
|
+
request.input("resourceId", resourceId);
|
|
1901
1903
|
request.input("snapshot", JSON.stringify(snapshot));
|
|
1902
1904
|
request.input("createdAt", sql2.DateTime2, new Date(now));
|
|
1903
1905
|
request.input("updatedAt", sql2.DateTime2, new Date(now));
|
|
@@ -1905,10 +1907,11 @@ var WorkflowsMSSQL = class extends WorkflowsStorage {
|
|
|
1905
1907
|
USING (SELECT @workflow_name AS workflow_name, @run_id AS run_id) AS src
|
|
1906
1908
|
ON target.workflow_name = src.workflow_name AND target.run_id = src.run_id
|
|
1907
1909
|
WHEN MATCHED THEN UPDATE SET
|
|
1910
|
+
resourceId = @resourceId,
|
|
1908
1911
|
snapshot = @snapshot,
|
|
1909
1912
|
[updatedAt] = @updatedAt
|
|
1910
|
-
WHEN NOT MATCHED THEN INSERT (workflow_name, run_id, snapshot, [createdAt], [updatedAt])
|
|
1911
|
-
VALUES (@workflow_name, @run_id, @snapshot, @createdAt, @updatedAt);`;
|
|
1913
|
+
WHEN NOT MATCHED THEN INSERT (workflow_name, run_id, resourceId, snapshot, [createdAt], [updatedAt])
|
|
1914
|
+
VALUES (@workflow_name, @run_id, @resourceId, @snapshot, @createdAt, @updatedAt);`;
|
|
1912
1915
|
await request.query(mergeSql);
|
|
1913
1916
|
} catch (error) {
|
|
1914
1917
|
throw new MastraError(
|
|
@@ -2293,9 +2296,10 @@ var MSSQLStore = class extends MastraStorage {
|
|
|
2293
2296
|
async persistWorkflowSnapshot({
|
|
2294
2297
|
workflowName,
|
|
2295
2298
|
runId,
|
|
2299
|
+
resourceId,
|
|
2296
2300
|
snapshot
|
|
2297
2301
|
}) {
|
|
2298
|
-
return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
2302
|
+
return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot });
|
|
2299
2303
|
}
|
|
2300
2304
|
async loadWorkflowSnapshot({
|
|
2301
2305
|
workflowName,
|