Skip to content

feat(data-editor): add MySQL ENUM and SET result editors - #2560

Merged
openai0229 merged 12 commits into
mainfrom
feat/2558-enum-result-editor
Aug 19, 2026
Merged

openai0229 merged 12 commits into
mainfrom
feat/2558-enum-result-editor

Conversation

@openai0229

@openai0229 openai0229 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #2558

Scope

Current database support: native MySQL only. The SPI and frontend editor intents are extensible, but every other database plugin, including MySQL-compatible dialects, keeps the existing text editor until it is implemented and verified.

Summary

  • Add a result-set editor metadata contract that returns the editor intent and its ordered options as one result.
  • Resolve MySQL ENUM and SET members from table-column metadata already loaded for result editing. This adds no SQL or metadata query.
  • Use the existing Ant Design Select component for both editors: single-select for ENUM and mode="multiple" for SET.
  • Open the dropdown when double-click editing starts.
  • Commit an ENUM option immediately after selection. Pressing Enter without changing the current ENUM value also finishes editing.
  • Keep SET editing open while Enter toggles members. Tab or clicking outside commits; Escape restores the original value.
  • Serialize SET selections in MySQL metadata order. Clearing all selections writes the empty SET value.
  • Fall back to the text editor for malformed or unresolved metadata and for SET definitions containing empty members or commas, which cannot be represented safely by the comma-delimited editor value.

Extension contract

  • IDbMetaData.resolveResultSetEditorMetadata(TableColumn) is the single extension point.
  • Its default implementation preserves the existing resolveResultSetEditorType(...) result and returns List.of() for options, so unsupported databases require no capability flag or branch.
  • ExecuteResultHeaderEnhancer calls the hook once for each matched result column and writes the returned editorType and editorOptions directly to Header.
  • Only the metadata instance created by MysqlPlugin overrides the hook today. MariaDB, TiDB, OceanBase, Doris, StarRocks, PostgreSQL, ClickHouse, and all other plugins remain on the default implementation.
  • Future database plugins can implement the same hook after their column metadata exposes the required ordered option values.

ENUM and SET metadata source

  • MySQL already queries information_schema.COLUMNS when loading editable table columns.
  • The existing COLUMN_TYPE handling stores ENUM/SET type arguments in TableColumn.value; the editor resolver parses that existing value.
  • No per-cell query, second schema lookup, or new network request is introduced.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • yarn test:result-set-editor - passed, including mounted Ant Select DOM interactions.
  • yarn lint:eslint - passed after merging the latest main.
  • Focused backend Maven tests - 9 tests passed with 0 failures, 0 errors, and 0 skipped.
  • Full backend Maven package - all 48 reactor modules passed.
  • MariaDB, TiDB, OceanBase, Doris, and StarRocks compile against the default metadata implementation.
  • git diff --check - passed.
  • Three focused review passes found no blocking or medium/high-risk issue in the SPI contract, tests, or MySQL metadata path.

Manual test data is available in the local Docker MySQL instance. Browser automation was not used.

Risk and compatibility

  • Public API or stored data: additive Header.editorOptions, SELECT, and MULTI_SELECT editor intents only; no storage migration.
  • Database or driver compatibility: native MySQL only. Compatibility dialects and other databases return the legacy editor type with an empty option list.
  • MySQL SET encoding: definitions containing empty members or commas fall back to text editing to avoid ambiguous writes.
  • UI consistency: ENUM and SET share Ant Design Select theming, popup behavior, positioning, and the VTable adapter; there is no custom checkbox picker.
  • Network, privacy, or security: no new request or metadata query. Database labels are passed to React as strings and are never rendered through innerHTML.
  • Community / Local / Pro boundary: Community source only.

Reviewer map

  • SPI contract and default behavior: IDbMetaData.resolveResultSetEditorMetadata.
  • Header enrichment and per-column failure isolation: ExecuteResultHeaderEnhancer.enrichEditorMetadata.
  • Native MySQL activation: MysqlPlugin.NativeMysqlMetaData.
  • MySQL mapping and fallback: MysqlMetaData.resolveMysqlResultSetEditorMetadata.
  • Frontend resolution: resolveResultSetEditor.
  • Shared component adapter: SelectEditor; SET specializes it through MultiSelectEditor.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below.

AI assistance: Substantial AI assistance was used for implementation, tests, and code review.

@openai0229
openai0229 force-pushed the feat/2558-enum-result-editor branch from 1f746d5 to 34ecd67 Compare August 5, 2026 03:08
@openai0229 openai0229 changed the title feat(data-editor): add extensible enum result editors feat(data-editor): add extensible enum contract and MySQL support Aug 5, 2026
@openai0229 openai0229 changed the title feat(data-editor): add extensible enum contract and MySQL support feat(data-editor): add MySQL ENUM and SET result editors Aug 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed c2716ce.

Findings: 0 critical, 0 high, 1 medium.

Merge recommendation: non-blocking follow-up requested. The SET multi-select editor intercepts Enter without committing, so the documented keyboard completion path does not work.

Coverage limit: read-only review of the current GitHub diff, PR metadata, linked issue, commits, reviews, and line comments. No tests or runtime checks were run.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by AI Pull Request Reviewer for #2560 · 17.9 AIC · ⌖ 2.82 AIC · ⊞ 17.3K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed e0ba947.

Findings: 0 critical, 0 high, 0 medium.

Merge recommendation: no actionable findings. The previously reported SET Enter completion issue is addressed in this head.

Coverage limit: read-only review of the current GitHub diff, PR metadata, existing reviews, and line comments. No tests or runtime checks were run.

``

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by AI Pull Request Reviewer for #2560 · 25.5 AIC · ⌖ 2.8 AIC · ⊞ 17.4K

@openai0229
openai0229 merged commit a1f1e7b into main Aug 19, 2026
16 checks passed
@openai0229
openai0229 deleted the feat/2558-enum-result-editor branch August 19, 2026 08:50
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[MYSQL-DATA-001] Add MySQL ENUM and SET result editors

1 participant