5 Commits
Author SHA1 Message Date
nngo 59aa235f3d Fix column's statistics errors 2026-05-22 09:41:08 -04:00
nngoandClaude Sonnet 4.6 04476bae11 Fix medium/low severity issues: script splitter, EXPLAIN, keyring, imports
execute_script() semicolon splitter (all drivers)
- Add BaseDriver._split_statements() that tracks single/double-quoted
  strings and -- / /* */ comments so semicolons inside procedure bodies
  are not treated as statement boundaries.
- Replace the naive sql.split(';') in all four drivers with this helper.
- MSSQL execute_script() also pre-splits on GO (case-insensitive, own
  line) so scripts pasted from SSMS work correctly.

MSSQL EXPLAIN
- SET SHOWPLAN_TEXT ON/execute/SET SHOWPLAN_TEXT OFF must be separate
  execute() calls; pyodbc rejects multiple statements in one call.
  Hold self._lock for the entire sequence to keep session state atomic.

Keyring (connections.py)
- Log warnings (with traceback) on load/save failures instead of
  silently returning "".
- save_password() now calls delete_password() when password is empty,
  so clearing a saved password actually removes the old keyring entry
  rather than leaving a stale one behind.

SQLite get_tables() O(N) lock acquisitions
- Run all COUNT(*) queries inside the same `with self._cur() as c:`
  block, reducing N+1 lock acquisitions to 1.

Unused import: remove psycopg2.extras from postgres_driver.py.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:12:40 -04:00
nngoandClaude Sonnet 4.6 4ccc81955e Fix high-severity issues: implement SSL and warn on raw-SQL filter
SSL was wired through the UI and ConnectionProfile but never actually
applied in any driver or passed from the connection builder.

- main_window: pass ssl/ssl_ca/ssl_cert/ssl_key from profile into
  the driver config dict so drivers can act on them
- MySQL: add ssl={ca,cert,key} to pymysql connect kwargs when enabled
- PostgreSQL: set sslmode=verify-ca (with CA) or require, plus
  sslrootcert/sslcert/sslkey when provided
- MSSQL: switch Encrypt=yes + TrustServerCertificate=no when SSL is
  on; Encrypt=no + TrustServerCertificate=yes otherwise
- SQLite: no change needed (local file, no network layer)

WHERE filter: add tooltip explicitly labelling the input as raw SQL
so users understand arbitrary expressions are executed directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:07:02 -04:00
nngoandClaude Sonnet 4.6 724594d3f1 Fix three critical bugs in ConnectionProfile and MSSQL driver
- Declare `password` as a proper dataclass field (repr=False) so it is
  visible to type checkers and any code path that constructs a bare
  ConnectionProfile; drop the now-unused Optional import.
- Fix _conn_str() fallback loop: the return was inside the for-body,
  so only ODBC Driver 18 was ever tried. Now uses pyodbc.drivers() to
  pick the first installed driver from the preference list.
- Make _cur() a thread-safe @contextmanager that holds self._lock for
  the cursor's lifetime, matching MySQL/PostgreSQL/SQLite. Updated all
  16 call sites to `with self._cur() as c:`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:02:04 -04:00
nngo b01ad5ea40 Initial Codes 2026-05-21 15:46:41 -04:00