Skip to content

feat(workflow): add database CRUD workflow nodes#441

Open
xpert-ai-dev[bot] wants to merge 1 commit into
mainfrom
feature/db-crud-workflow-nodes
Open

feat(workflow): add database CRUD workflow nodes#441
xpert-ai-dev[bot] wants to merge 1 commit into
mainfrom
feature/db-crud-workflow-nodes

Conversation

@xpert-ai-dev

@xpert-ai-dev xpert-ai-dev Bot commented Mar 10, 2026

Copy link
Copy Markdown

Summary

This PR implements database CRUD workflow nodes for the Xpert workflow system, addressing GitHub issue #218.

Changes

1. Updated Interfaces (packages/contracts/src/ai/xpert-table.model.ts)

  • Added TDBWhereCondition type for WHERE clause conditions
  • Added TDBOrderBy type for ORDER BY clauses
  • Enhanced IWFNDBUpdate with where?: TDBWhereCondition[]
  • Enhanced IWFNDBDelete with where?: TDBWhereCondition[]
  • Enhanced IWFNDBQuery with columns, where, orderBy, limit properties

2. Added Service Methods (packages/server-ai/src/xpert-table/xpert-table.service.ts)

  • queryRows() - Query rows with columns, where, orderBy, limit options
  • updateRows() - Update rows with SET values and WHERE conditions
  • deleteRows() - Delete rows with WHERE conditions

3. Backend Strategies

  • Added WorkflowDBUpdateNodeStrategy - handles database update operations
  • Added WorkflowDBDeleteNodeStrategy - handles database delete operations
  • Added WorkflowDBQueryNodeStrategy - handles database query operations
  • Registered all strategies in plugins index

4. Frontend Components

  • Created DB Query panel component (db-query.component.ts, .html, .scss)
  • Registered in workflow panel component

Workflow Node Types Available

Node Type Description
DB_INSERT Insert rows into a table
DB_UPDATE Update rows with WHERE conditions
DB_DELETE Delete rows with WHERE conditions
DB_QUERY Query rows with columns, where, orderBy, limit
DB_SQL Execute custom SQL statements

Testing

  • All strategies follow the existing pattern used by WorkflowDBInsertNodeStrategy and WorkflowDBSQLNodeStrategy
  • Service methods use the existing DBTableDataAction enum from the plugin SDK
  • Frontend components follow the existing component structure

Closes #218

- Add IWFNDBUpdate, IWFNDBDelete, IWFNDBQuery interfaces with where conditions
- Add TDBWhereCondition and TDBOrderBy types for database operations
- Implement queryRows, updateRows, deleteRows methods in XpertTableService
- Add WorkflowDBUpdateNodeStrategy, WorkflowDBDeleteNodeStrategy, WorkflowDBQueryNodeStrategy
- Create frontend panel component for DB Query node
- Register all DB CRUD strategies in plugins index

Closes #218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Workflow Nodes for Database CRUD Operations

0 participants