Skip to content

feat: support Oracle trigger editing in table structure editor#3456

Open
mikodream wants to merge 2 commits into
t8y2:mainfrom
mikodream:main
Open

feat: support Oracle trigger editing in table structure editor#3456
mikodream wants to merge 2 commits into
t8y2:mainfrom
mikodream:main

Conversation

@mikodream

@mikodream mikodream commented Jul 14, 2026

Copy link
Copy Markdown

变更说明

支持oracle DDL操作

变更类型

  • [ x ] 新功能

  • Bug 修复

  • 性能优化

  • 代码重构

  • 文档更新

  • CI / 构建

    • 前端允许 Oracle 进入触发器编辑:apps/desktop/src/components/structure/TableStructureEditor.vue:2065
    • 后端支持 Oracle trigger DDL:crates/dbx-core/src/table_structure_sql/triggers.rs:12
      • MySQL 行为保持不变:DROP TRIGGER + CREATE TRIGGER
      • Oracle 创建时也限定 schema:CREATE OR REPLACE TRIGGER "schema"."trigger_name" ... ON "schema"."table"

@t8y2 t8y2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to request changes for now. The current metadata and editor model cannot safely edit existing Oracle triggers.

  1. Oracle's TRIGGER_TYPE is returned as values such as BEFORE EACH ROW, while create_trigger_sql only accepts BEFORE or AFTER. The Oracle agent also does not return the trigger statement, so existing triggers open with an empty body. Even a simple existing row trigger therefore cannot be edited and saved correctly.

  2. Reconstructing the trigger from only timing, event, table, and body is lossy for valid Oracle triggers. Clauses such as multiple events, UPDATE OF, REFERENCING, WHEN, statement-level/INSTEAD OF triggers, and compound triggers are not preserved and can be silently removed after an edit.

Please load and edit the complete Oracle trigger source, or explicitly restrict editing to a safely detected subset while keeping unsupported triggers read-only. Add integration coverage using metadata values returned by a real Oracle instance, rather than only manually constructed BEFORE/UPDATE test data.

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.

2 participants