dbx/crates/dbx-core
jischeng a595d4d4bd
feat(mysql): support external catalogs (Paimon/Hive) via catalog= URL param
StarRocks/Doris expose external storage through a catalog. dbx had no
catalog concept, so connecting to e.g. `paimon_catalog.clip` failed: the
URL path's database was sent as the MySQL handshake schema and rejected
before any `SET catalog` could run, and table listing/preview ran against
the default catalog.

Add an opt-in `catalog=<name>` URL parameter for mysql-family connections:

- `mysql_connection_catalog`: reads the `catalog` param (percent-decoded).
- `mysql_setup_queries`: emits `SET catalog = <name>` when present. Pushed
  last so mysql_async's back-to-front setup execution (Vec::pop) runs it
  before `USE <database>`, which would otherwise fail (the database lives
  in the external catalog). The pool re-runs setup after each reset, so the
  catalog stays current.
- `mysql_async_url`: when a catalog is configured, strip the database path
  from the URL handed to mysql_async so the handshake does not send the
  external-catalog database as the schema. The original URL (with path) is
  still used for setup, so `USE <database>` is emitted correctly.
- Add `catalog` to `is_dbx_handled_mysql_url_param` so mysql_async ignores
  the unknown param.

This is opt-in: only connections that set `catalog=` are affected; all
existing mysql/StarRocks/Doris connections behave unchanged. Configure a
Paimon connection as `database=clip`, `url_params=catalog=paimon_catalog`.

Verified against a StarRocks + Paimon catalog via the dbx MCP bridge:
SHOW DATABASES, SHOW TABLES, DESCRIBE, and unqualified `SELECT * FROM <t>`
all resolve in the selected catalog.
2026-06-25 18:07:26 +08:00
..
assets feat(zookeeper): add agent client browsing and node management 2026-06-25 00:40:48 +08:00
src feat(mysql): support external catalogs (Paimon/Hive) via catalog= URL param 2026-06-25 18:07:26 +08:00
tests fix(sqlserver): stream query result exports 2026-06-25 16:16:30 +08:00
Cargo.toml feat(mq): implement Apache Pulsar message queue admin 2026-06-16 21:57:17 +08:00