Skip to content

feat(sql-editor): add output history retention option - #2270

Merged
openai0229 merged 3 commits into
mainfrom
feat/2269-keep-history-output
Jul 27, 2026
Merged

feat(sql-editor): add output history retention option#2270
openai0229 merged 3 commits into
mainfrom
feat/2269-keep-history-output

Conversation

@openai0229

@openai0229 openai0229 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #2269

Summary

  • Add a Keep history output option to the execution console menu, enabled by default and persisted per edition/runtime.
  • When disabled, retain only the newest SQL execution output across Web and Desktop runtimes.
  • Prevent late events from superseded executions from restoring older output, including Desktop requests whose first event arrives out of order.
  • Synchronize the preference across mounted editors and bound superseded-execution tracking to 200 entries.

Affected surfaces

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

Verification

  • Commands and results:
    • yarn test:execution-console - passed
    • yarn test:sql-execution-log - passed
    • yarn test:i18n - passed
    • yarn lint - passed
    • yarn build:web:community --app_version=5.3.0 - passed
    • git diff --check - passed
  • Manual verification: N/A - no local runtime was started.
  • UI evidence: N/A - no local runtime was started.

Risk and compatibility

  • Public API or stored data: Adds one client-side localStorage preference key; no public API or server-side data changes.
  • Database or driver compatibility: N/A - execution and driver behavior are unchanged.
  • Network, privacy, or security: N/A - no network, privacy, or security behavior changes.
  • Community / Local / Pro boundary: Community frontend only; the preference key remains scoped by edition and runtime.
  • Backward compatibility: Existing behavior is preserved by default because history retention defaults to enabled.

Reviewer map

  • Start here: chat2db-community-client/src/service/sqlExecutionLog.ts, then src/pages/main/workspace/components/SQLExecute/index.tsx.
  • Failure condition: Enabled mode loses prior output, disabled mode retains more than the newest execution, or a late superseded event restores older output.
  • Rollback or disable path: Revert this PR; users can also leave the new option enabled to preserve the prior behavior.

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, or this PR contains no substantial AI-generated code.

AI assistance: Substantial AI assistance was used for implementation, tests, edge-case analysis, and review. The final diff and verification results were reviewed before submission.

@openai0229
openai0229 merged commit 452b068 into main Jul 27, 2026
14 checks passed
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Jul 27, 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.

feat(sql-editor): add output history retention option

2 participants