* feat(core): implement PIP-0001 database connection timeout recovery
- Add DbOperationBudget struct for unified execution budget model
- Add deadpool create/recycle timeout for PostgreSQL pools
- Add checkout_postgres_client helper replacing 14 bare pool.get() calls
with timeout + cancel token support
- Fix PostgreSQL TLS cancel: rebuild TLS connector from stored context,
fallback to NoTls on failure
- Add timeout to MySQL kill_query and kill_query_with_opts (5s)
- Extend is_connection_error to match deadpool pool timeout messages
- Unify keepalive default to 30s (was 60s Rust / 0s frontend mismatch)
- Inject PostgreSQL TCP keepalive params (idle=30s, interval=10s, retries=3)
- Inject MySQL tcp_keepalive=30s in OptsBuilder
- Make MySQL inactive_connection_ttl configurable from idle_timeout_secs
- Add stage-based structured logging for pool.checkout/health.check/cancel
- Store PostgresCancelContext in AppState for TLS cancel reconstruction
- Clean up cancel contexts on pool removal/drain
- Add unit tests for DbOperationBudget and pool timeout error detection
* fix(core): align timeout recovery with PIP-0001
* fix(core): handle timeout recovery review issues
* fix(core): complete connection timeout recovery
* fix(core): fall back postgres cancel connector build
* refactor: revert comment translations to English in connection.rs and query.rs
- Revert DbOperationBudget doc comments to English (query.rs)
- Revert PostgresCancelContext and TLS cancel comments to English (connection.rs)
- Keep Chinese error-matching strings in is_connection_error unchanged
---------
Co-authored-by: onceMisery <onceMisery@users.noreply.github.com>
* fix(starrocks): detect primary keys via information_schema.COLUMNS
The Doris family (StarRocks/Doris) loaded columns through `SHOW COLUMNS`
for performance (perf(doris) commit 69ecde8f). However StarRocks reports
the `Key` column as `YES`/`NO` instead of MySQL's `PRI`, so `is_primary_key`
was never set and the data grid always showed "无主键定位" (keyless edit
warning) for tables that actually have a primary key.
Switch to `get_columns`, which queries information_schema.COLUMNS first —
where `COLUMN_KEY = 'PRI'` correctly identifies primary keys (and only real
primary keys, not duplicate-key sort columns) — and still falls back to
`SHOW COLUMNS` when information_schema is unavailable.
Verified against a live StarRocks connection: information_schema.COLUMNS
reports `COLUMN_KEY = 'PRI'` for primary-key columns while `SHOW COLUMNS`
reports `Key = YES`. Paimon catalog tables are unaffected (both paths
report no primary key for them).
* fix(test): add redis_scan_page_size to ConnectionConfig test helpers
`d815a16b` (feat(redis): move scan page size to connections) added
`redis_scan_page_size` to `ConnectionConfig` but did not update several
struct-literal test helpers, so `cargo clippy --workspace --all-targets`
fails with `missing field redis_scan_page_size`. This is a pre-existing
breakage on `main` (CI has been red since that commit) and is unrelated to
this PR's actual change; included here only to unblock CI.
Helpers fixed here:
- src-tauri/src/commands/connection.rs (`mongodb_config`)
- crates/dbx-web/src/routes/connection.rs (`sqlite_config`)
* fix(mysql): health-check pooled connection before DDL query
`mysql_ddl` fetched a connection with a raw `pool.get_conn()` and issued
`SHOW CREATE TABLE` directly, unlike other read paths (`get_columns`,
`list_indexes`, ...) which go through `get_conn_with_health_check`. A
pooled connection that went stale while idle (server closed it after its
idle timeout, NAT/firewall dropped the TCP state, ...) would then fail on
the first DDL request after a period of inactivity, surfacing a low-level
connection error that a manual refresh would mask.
Route `mysql_ddl` through `get_conn_with_health_check` so stale
connections are pinged and replaced before the query runs, matching the
rest of the MySQL metadata path.
* fix(test): add redis_scan_page_size to ConnectionConfig test helpers
`d815a16b` (feat(redis): move scan page size to connections) added
`redis_scan_page_size` to `ConnectionConfig` but did not update several
struct-literal test helpers, so `cargo clippy --workspace --all-targets`
fails with `missing field redis_scan_page_size`. This is a pre-existing
breakage on `main` (CI has been red since that commit) and is unrelated to
this PR's actual change; included here only to unblock CI.
Helpers fixed here:
- src-tauri/src/commands/connection.rs (`mongodb_config`)
- crates/dbx-web/src/routes/connection.rs (`sqlite_config`)