Commit Graph
157 Commits
Author SHA1 Message Date
t8y2 dafed47b07 fix: improve database error message extraction for queries
- frontend: use e.message instead of String(e) in toErrorResult to avoid
  "Error: " prefix for HTTP-mode errors, matching connectionErrorMessage
- frontend: apply same fix to MongoDocBrowser error display
- backend(postgres): use pg_error_to_string across all query execution
  paths (execute, execute_batch, copy_out, copy_in) to extract DbError
  details instead of generic transport-layer errors

Other databases (MySQL, SQL Server, SQLite, DuckDB) already include
server-level error details in their native Error::to_string().
2026-05-27 15:40:28 +08:00
t8y2 e9a2c08a46 feat(db): support TLS client certificates 2026-05-27 13:54:32 +08:00
t8y2 a296bd6c3c fix(duckdb): explicitly close connections to release file locks on Windows
DuckDB opens database files with exclusive locks on Windows. Previously
connections were only released via Drop, which may not release the file
handle synchronously, causing "file already in use" errors when
reconnecting or testing connections in quick succession.
2026-05-27 13:53:14 +08:00
vvrf bcfad319a6 fix: allow mysql timestamp default null ddl 2026-05-27 13:31:22 +08:00
t8y2 745f37fa6d fix(mysql): avoid garbled binary value previews 2026-05-27 12:56:53 +08:00
t8y2 ad7db2cb49 chore: format rust sources 2026-05-26 22:58:20 +08:00
vvrf 3a595c8efb fix: render binary values as hex (#465) 2026-05-26 22:46:00 +08:00
t8y2 32273b4d6e feat: support Redis Sentinel connections 2026-05-26 19:44:23 +08:00
t8y2 f9b58993b4 fix: add TLS connection settings 2026-05-26 17:32:05 +08:00
t8y2 11ed019b0e fix: render postgres array values 2026-05-26 15:49:51 +08:00
t8y2 5a420548fb fix: set mysql connection charset 2026-05-26 12:15:35 +08:00
t8y2 affd8b38a1 fix: include postgres template databases in picker 2026-05-26 12:10:07 +08:00
t8y2 76a0b9f76d fix: let users opt into system databases 2026-05-26 12:06:48 +08:00
t8y2 f895bb4de5 fix: scope agent metadata by database 2026-05-26 11:51:58 +08:00
t8y2 0fec2b5984 fix: allow postgres sslmode require with custom cas 2026-05-26 11:36:10 +08:00
t8y2 23d04645f6 fix: display MySQL BIT(1) columns as numeric strings instead of garbled text
BIT columns arrive as raw bytes from mysql_async. Without specialized
handling, byte 0x01 was treated as a valid UTF-8 control character and
byte 0x00 was replaced with U+FFFD. Now BIT values are interpreted as
big-endian integers, so BIT(1) correctly displays "0" or "1".
2026-05-26 11:22:23 +08:00
t8y2 5f3606e5b5 fix: handle postgres system catalog query results 2026-05-26 11:05:07 +08:00
t8y2 fe2ecd60d2 feat: add ClickHouse TLS connection support 2026-05-25 21:07:22 +08:00
t8y2 234099aebd feat: use native postgres path for GaussDB connections 2026-05-25 19:25:35 +08:00
t8y2 d326cb0ced fix: scope query connections by client session 2026-05-25 17:23:36 +08:00
t8y2 9f6c35ee78 fix: make MySQL connection timeout configurable via URL param connect_timeout
Previously the connection timeout was hardcoded to 5s via
tokio::time::timeout, ignoring any connect_timeout in the URL.
Also mysql_async rejected camelCase connectTimeout as unknown.

Now parse_connect_timeout extracts connect_timeout/connectTimeout from
the URL (case-insensitive, 1-300s range), removes them before passing
to mysql_async, and feeds the value to with_connection_timeout.
2026-05-25 16:23:25 +08:00
t8y2 d973fb78c1 fix: disable prefer_socket in mysql_async to fix StarRocks connection after upgrade
Newer StarRocks versions reject the @@socket system variable that
mysql_async queries during connection initialization when prefer_socket
is enabled (default on non-Windows). Since we always use TCP connections,
Unix socket detection is unnecessary.
2026-05-25 14:12:55 +08:00
WangXinandClaude Opus 4.7 67572cd685 fix(mysql): degrade gracefully when routines lookup fails
Split the object browser query into separate TABLES and ROUTINES
fetches. Some MySQL-compatible servers (sharding proxies, restricted
accounts, OceanBase/TiDB variants) reject information_schema.ROUTINES
with ER_UNKNOWN_ERROR (1105 HY000), which previously took down the
entire object browser. Now ROUTINES failures are logged and the user
still gets tables and views.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 11:10:17 +08:00
t8y2 991921428b fix(postgres): respect user-specified timezone in connection parameters
Previously connect() always overwrote the timezone with the local machine's
timezone, even when the user had explicitly set one via connection parameters
(e.g. ?options=-c timezone=Asia/Shanghai). Now we check the URL for a
timezone setting and skip the automatic SET timezone if one is present.
2026-05-24 19:57:34 +08:00
t8y2 a34a8abe65 fix(postgres): reset search_path after schema-scoped queries to prevent pool connection state leak
SET search_path in PostgreSQL is not transactional — it survives rollback
and persists on the connection. Previously, connections returned to the pool
with a modified search_path, causing subsequent queries on the same
connection to run against the wrong schema. Now RESET search_path is always
called after schema-scoped queries and transactions.
2026-05-24 19:22:55 +08:00
t8y2 e83c335a70 refactor(postgres): replace sqlx with tokio-postgres + deadpool-postgres
- Use client.transaction() for safer transaction handling
- Add prepare_cached for all system queries to enable statement caching
- Use query_raw streaming to avoid buffering large result sets
- Add batch_execute support for bulk DDL scripts
- Add COPY protocol support (copy_in / copy_out) for fast data transfer
- Add pg_quote_ident to prevent SQL injection in SET search_path
- Increase connection pool max_size from 5 to 10
- Fix list_indexes bounds check for expression indexes
2026-05-24 18:53:20 +08:00
t8y2 b77c02c829 refactor(sqlite): migrate to rusqlite, fix sql statement splitter
Fix SqlStatementSplitter.push_current_statement to preserve leading
comments with their following SQL statement instead of stripping them.
2026-05-24 15:47:36 +08:00
t8y2 3e051d61a7 fix(dbx-core): migrate mysql driver to mysql_async
Add mysql_async with client_ed25519 support for MySQL and MariaDB connections.\nSwitch MySQL transaction control and schema metadata reads away from sqlx MySQL APIs.\nPreserve connection compatibility by stripping unsupported URL params and handling nullable metadata safely.
2026-05-24 00:53:27 +08:00
t8y2 777cb11081 fix(sqlite): rewrite if()→IIF() and substring()→substr() for cross-DB view compatibility 2026-05-23 23:26:32 +08:00
t8y2 ccfc3cf92c fix(postgres): remove trailing comma in SQL query for table comments 2026-05-23 09:25:53 +08:00
t8y2 51662c692f feat(objects): default filter to tables and align context menu with sidebar (#416)
Object browser now defaults to showing tables when tables exist.
Table/view context menus match sidebar tree with structure editing,
export, import, diagram, data compare, truncate, empty, duplicate,
and copy name support.
2026-05-22 19:15:22 +08:00
t8y2 ebf8f674c0 fix(mysql): detect StarRocks primary keys 2026-05-22 18:37:28 +08:00
t8y2 1fab46bca3 fix(agent): support oracle 10g java runtime 2026-05-22 17:23:26 +08:00
t8y2 5ab0489127 fix(sqlserver): support named instances 2026-05-22 17:06:05 +08:00
t8y2 56aeed79fc fix(mysql): support legacy routine metadata 2026-05-22 15:14:19 +08:00
t8y2 c1fc1c9b70 feat(objects): show object timestamps 2026-05-22 11:37:23 +08:00
t8y2 528c3c3ffc fix(agent): open java sql module for timestamps 2026-05-21 18:48:20 +08:00
t8y2 ae50a6ec9e fix(mysql): run SHOW GRANTS via text protocol 2026-05-21 16:45:48 +08:00
t8y2 cb7682e932 fix(mysql): normalize temporal SQL literals 2026-05-21 14:14:38 +08:00
t8y2 4f379be24a fix(connection): support SAP HANA tenant routing 2026-05-21 00:32:19 +08:00
t8y2 2310201a14 fix(mysql): preserve session timezone
Keep the server session timezone for standard MySQL connections unless the connection URL explicitly provides a timezone override. This avoids TIMESTAMP shifts during SQL import while preserving user-specified timezone parameters.
2026-05-20 18:58:50 +08:00
t8y2 c53caddc3f fix(sqlserver): route transaction control statements through simple_query
BEGIN TRANSACTION / COMMIT / ROLLBACK must not go through sp_executesql
(client.execute) because SQL Server raises error 266 when @@TRANCOUNT
changes inside sp_executesql. Route them through simple_query instead.
2026-05-20 13:36:08 +08:00
t8y2 abafa49acc fix(agent): bound read_agent_line to prevent OOM abort on large responses
Add a 512MB maximum response size limit to read_agent_line to prevent
unbounded memory allocation that could cause the process to SIGABRT
when the agent returns an unexpectedly large response.

Ref: #345
2026-05-20 10:49:11 +08:00
t8y2 ea19a24ec6 fix(mysql): retry without ssl on TLS close 2026-05-20 10:42:20 +08:00
t8y2 f84335e986 fix(elasticsearch): parse aggregation query results into table format (#344)
Previously, aggregation queries (date_histogram, terms, etc.) with
`size: 0` returned empty results because the empty hits array was
matched but contained no documents, ignoring the aggregations data.
2026-05-20 10:12:20 +08:00
yavon007 b9bcb90ac7 fix(mysql): avoid metadata collation conflicts (#341)
Split MySQL column and primary key metadata lookups so MariaDB and OceanBase do not join information_schema tables with incompatible collations.
2026-05-20 01:22:46 +08:00
t8y2 e8cbe6bbf0 fix(mysql): add COLLATE to get_columns JOIN for OceanBase compatibility
OceanBase MySQL mode uses different collations for information_schema
tables, causing "Illegal mix of collations" when joining COLUMNS with
KEY_COLUMN_USAGE. Explicit COLLATE utf8mb4_general_ci resolves this.

Closes #337
2026-05-19 18:36:47 +08:00
t8y2 2ebd72ab6d refactor(agent): retain handshake capabilities 2026-05-19 16:07:25 +08:00
t8y2 fa2e710a7b test(agent): validate protocol contract 2026-05-19 16:05:25 +08:00
t8y2 077aaa5c06 refactor(agent): wrap remaining protocol calls 2026-05-19 15:54:57 +08:00