@mastra/clickhouse 1.2.2 → 1.2.3
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 +18 -0
- package/LICENSE.md +15 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-storage-composite.md +41 -41
- package/dist/index.cjs +11 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -48
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +3 -2
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2920,6 +2920,9 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
2920
2920
|
this.client = client;
|
|
2921
2921
|
this.#db = new ClickhouseDB({ client, ttl });
|
|
2922
2922
|
}
|
|
2923
|
+
supportsConcurrentUpdates() {
|
|
2924
|
+
return false;
|
|
2925
|
+
}
|
|
2923
2926
|
async init() {
|
|
2924
2927
|
const schema = TABLE_SCHEMAS[TABLE_WORKFLOW_SNAPSHOT];
|
|
2925
2928
|
await this.#db.createTable({ tableName: TABLE_WORKFLOW_SNAPSHOT, schema });
|
|
@@ -2932,55 +2935,15 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
2932
2935
|
async dangerouslyClearAll() {
|
|
2933
2936
|
await this.#db.clearTable({ tableName: TABLE_WORKFLOW_SNAPSHOT });
|
|
2934
2937
|
}
|
|
2935
|
-
async updateWorkflowResults({
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
result,
|
|
2940
|
-
requestContext
|
|
2941
|
-
}) {
|
|
2942
|
-
let snapshot = await this.loadWorkflowSnapshot({ workflowName, runId });
|
|
2943
|
-
if (!snapshot) {
|
|
2944
|
-
snapshot = {
|
|
2945
|
-
context: {},
|
|
2946
|
-
activePaths: [],
|
|
2947
|
-
timestamp: Date.now(),
|
|
2948
|
-
suspendedPaths: {},
|
|
2949
|
-
activeStepsPath: {},
|
|
2950
|
-
resumeLabels: {},
|
|
2951
|
-
serializedStepGraph: [],
|
|
2952
|
-
status: "pending",
|
|
2953
|
-
value: {},
|
|
2954
|
-
waitingPaths: {},
|
|
2955
|
-
runId,
|
|
2956
|
-
requestContext: {}
|
|
2957
|
-
};
|
|
2958
|
-
}
|
|
2959
|
-
snapshot.context[stepId] = result;
|
|
2960
|
-
snapshot.requestContext = { ...snapshot.requestContext, ...requestContext };
|
|
2961
|
-
await this.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
2962
|
-
return snapshot.context;
|
|
2938
|
+
async updateWorkflowResults(_args) {
|
|
2939
|
+
throw new Error(
|
|
2940
|
+
"updateWorkflowResults is not implemented for ClickHouse storage. ClickHouse is an OLAP database and does not support atomic read-modify-write operations needed for concurrent workflow updates."
|
|
2941
|
+
);
|
|
2963
2942
|
}
|
|
2964
|
-
async updateWorkflowState({
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
}) {
|
|
2969
|
-
const snapshot = await this.loadWorkflowSnapshot({ workflowName, runId });
|
|
2970
|
-
if (!snapshot) {
|
|
2971
|
-
return void 0;
|
|
2972
|
-
}
|
|
2973
|
-
if (!snapshot.context) {
|
|
2974
|
-
throw new MastraError({
|
|
2975
|
-
id: createStorageErrorId("CLICKHOUSE", "UPDATE_WORKFLOW_STATE", "CONTEXT_MISSING"),
|
|
2976
|
-
domain: ErrorDomain.STORAGE,
|
|
2977
|
-
category: ErrorCategory.SYSTEM,
|
|
2978
|
-
text: `Snapshot context is missing for runId ${runId}`
|
|
2979
|
-
});
|
|
2980
|
-
}
|
|
2981
|
-
const updatedSnapshot = { ...snapshot, ...opts };
|
|
2982
|
-
await this.persistWorkflowSnapshot({ workflowName, runId, snapshot: updatedSnapshot });
|
|
2983
|
-
return updatedSnapshot;
|
|
2943
|
+
async updateWorkflowState(_args) {
|
|
2944
|
+
throw new Error(
|
|
2945
|
+
"updateWorkflowState is not implemented for ClickHouse storage. ClickHouse is an OLAP database and does not support atomic read-modify-write operations needed for concurrent workflow updates."
|
|
2946
|
+
);
|
|
2984
2947
|
}
|
|
2985
2948
|
async persistWorkflowSnapshot({
|
|
2986
2949
|
workflowName,
|