From 33214f66e155a67634b1955fb4af8f7a66e97224 Mon Sep 17 00:00:00 2001 From: Nikhil-Doye Date: Thu, 23 Oct 2025 14:48:43 -0400 Subject: [PATCH] Add database operation configuration to fieldConfigs - Introduced a new 'operation' entry in fieldConfigs to define various database operations (Query, Insert, Update, Delete, Aggregate, Transaction). - Enhanced user guidance with descriptions, help text, and examples for each operation type. - Updated field mappings to consolidate database operation parameters under a single entry for improved clarity and maintainability. --- src/config/fieldConfigs.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/config/fieldConfigs.ts b/src/config/fieldConfigs.ts index 9f796c0..aaaeedd 100644 --- a/src/config/fieldConfigs.ts +++ b/src/config/fieldConfigs.ts @@ -220,6 +220,24 @@ export const fieldConfigs: Record = { required: true, }, }, + operation: { + technicalName: "operation", + userFriendlyName: "Database operation", + description: "Choose what type of database operation to perform", + helpText: + "Select the type of database operation you want to perform. Each operation has different configuration options.", + examples: [ + "Query - Retrieve data from database", + "Insert - Add new records", + "Update - Modify existing records", + "Delete - Remove records", + "Aggregate - Count, sum, average data", + "Transaction - Multiple operations together", + ], + validation: { + required: true, + }, + }, // Output Fields format: { @@ -353,10 +371,7 @@ export const getFieldsForNodeType = (nodeType: string): string[] => { similaritySearch: ["vectorStore", "topK", "threshold", "label"], structuredOutput: ["schema", "model", "label"], dataOutput: ["format", "filename", "label"], - databaseQuery: ["connectionId", "query", "table", "label"], - databaseInsert: ["connectionId", "table", "label"], - databaseUpdate: ["connectionId", "table", "label"], - databaseDelete: ["connectionId", "table", "label"], + database: ["connectionId", "operation", "label"], }; return fieldMappings[nodeType] || [];