quicksql icon indicating copy to clipboard operation
quicksql copied to clipboard

Add toggles for auto Diagram redraw and auto SQL regeneration, with manual “Regenerate” for large models

Open pallasinfotech opened this issue 5 months ago • 0 comments

Summary The new Diagram is excellent, but on large scripts (60+ tables) QuickSQL redraws the Diagram and regenerates SQL on every keystroke, causing severe lag. Please add settings to control both behaviors so large projects remain usable.

Problem / Impact

  • Each character typed triggers a full Diagram layout and SQL preview regeneration.
  • With many tables/relations, typing stalls for seconds, CPU spikes, and the editor becomes unresponsive.
  • This pushes users to avoid the Diagram/Preview on the projects that need them most.

Steps to Reproduce

  1. Open a QuickSQL script with ~60+ tables (many FKs).
  2. Open the Diagram and SQL preview panels.
  3. Type in the editor.
  4. Observe continuous re-layout and SQL regeneration on every keystroke, with noticeable lag.

Expected Behavior I should be able to disable automatic Diagram redraw and automatic SQL regeneration, and manually trigger updates when ready.

Proposed Solution Add two independent settings (per script; remembered across sessions):

  • Diagram ▸ Auto redraw [On | Off]

    • On (default for small scripts): Redraw automatically (debounced).
    • Off (recommended for large scripts): Show “Regenerate Diagram” button/command to update on demand; hide it when On.
  • SQL Preview ▸ Auto regenerate [On | Off]

    • On (default for small scripts): Regenerate automatically (debounced).
    • Off: Show “Regenerate SQL” button/command to update on demand; optional “Regenerate on Save” toggle.

Performance/UX details

  • Debounce auto updates (e.g., 500–1000 ms after typing stops) to avoid per-keystroke work.

  • Heuristic default: If model size exceeds a threshold (e.g., >40 tables or >N relationships), default both toggles to Off and notify the user with an option to re-enable.

  • Non-blocking compute: Run layout and SQL generation off the main UI thread so the editor stays responsive.

  • Status indicator: When auto is Off, show a small “Preview/Diagram out of date” badge with last generated timestamp.

  • Keyboard shortcuts:

    • Regenerate Diagram: Ctrl/Cmd+Shift+D
    • Regenerate SQL: Ctrl/Cmd+Shift+S
    • Regenerate All: Ctrl/Cmd+Shift+R

Alternatives / Future Enhancements

  • Incremental/partial Diagram layout (only affected nodes/edges).
  • Progressive rendering of the Diagram.
  • Incremental SQL regeneration (only affected objects) when feasible.

Environment

  • QuickSQL (APEX 24.2) on Oracle Cloud, Autonomous Database 23ai.
  • Script size: 60+ tables, many relationships.

Labels enhancement performance ux diagram sql-generation

pallasinfotech avatar Aug 12 '25 02:08 pallasinfotech