Database Tool Window: Re-execution Guard for Uncertain Write Outcomes
0 reputation · 16 Feb 2025, 01:39 UTC
Context
PyCharm's Database tool window executes SQL statements exactly as submitted and does not automatically retry a write after a network interruption or query timeout. Autocommit and manual commit/rollback controls are available, but the IDE provides no built-in idempotency token, deduplication table, or replay protection for INSERT, UPDATE, or DELETE statements.
Unresolved Behavior
When a write statement times out or the session drops, the transaction outcome at the server remains unknown until the user reconnects and queries the target table. Re-executing the same statement in the console can therefore duplicate the change unless the database schema (for example, a unique constraint) prevents it. Current versions leave the decision to re-run entirely to the user, with no warning that the prior execution may have committed.
Open Questions
- Should the Database tool window surface a confirmation dialog or inline warning when the user attempts to re-execute a write statement whose previous execution ended in a timeout or lost connection?
- Would a per-session "last write status" indicator (committed, rolled back, unknown) reduce accidental duplicates without adding friction for intentional retries?
- Is there a configuration flag or plugin extension point that could enable such a guard without modifying the core console behavior for all users?