@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/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
- workflowName,
2937
- runId,
2938
- stepId,
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
- workflowName,
2966
- runId,
2967
- opts
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,