Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(mq): hide new-query entry for message queue connections

onenewcode4b6465606948
diff --git a/apps/desktop/src/lib/__tests__/database/databaseFeatureSupport.spec.ts b/apps/desktop/src/lib/__tests__/database/databaseFeatureSupport.spec.ts
index 5ac948ba2e..124d39ef77 100644
--- a/apps/desktop/src/lib/__tests__/database/databaseFeatureSupport.spec.ts
+++ b/apps/desktop/src/lib/__tests__/database/databaseFeatureSupport.spec.ts
@@ -98,6 +98,21 @@ describe("connection query actions", () => {
expect(supportsConnectionQueryActions("hbase")).toBe(false);
expect(supportsConnectionQueryActions("zookeeper")).toBe(false);
});
+
+ it("hides the sidebar new-query entry for message brokers", () => {
+ // Kafka/Pulsar/RocketMQ/RabbitMQ all share db_type "mq" and have no SQL
+ // engine: the sidebar entry opened a plain SQL editor against a broker
+ // (issue #8415). MQTT has the same console-only surface.
+ expect(supportsConnectionQueryActions("mq")).toBe(false);
+ expect(supportsConnectionQueryActions("mqtt")).toBe(false);
+ });
+});
+
+describe("message queue query capabilities", () => {
+ it("does not advertise query execution for broker surfaces", () => {
+ expect(supportsQueryExecution("mq")).toBe(false);
+ expect(supportsQueryExecution("mqtt")).toBe(false);
+ });
});
describe("zookeeper query capabilities", () => {
diff --git a/apps/desktop/src/lib/database/databaseFeatureSupport.ts b/apps/desktop/src/lib/database/databaseFeatureSupport.ts
index a4e1650c21..6e0e35044a 100644
--- a/apps/desktop/src/lib/database/databaseFeatureSupport.ts
+++ b/apps/desktop/src/lib/database/databaseFeatureSupport.ts
@@ -117,9 +117,14 @@ export function supportsClearableQuerySchema(dbType?: DatabaseType): boolean {
* so the sidebar "new query" flow would call list-databases and fail
* (issue #8215). It is excluded alongside the other specialized surfaces
* (nacos, consul, hbase) whose connection workbench replaces query tabs.
+ *
+ * The message-queue surfaces (`mq` — Pulsar/Kafka/RocketMQ/RabbitMQ — and
+ * `mqtt`) belong to the same group: brokers have no SQL engine, and their
+ * workbench is the MQ/MQTT admin tab. The sidebar entry used to open a plain
+ * SQL editor against a broker (issue #8415).
*/
export function supportsConnectionQueryActions(dbType?: DatabaseType): boolean {
- return dbType !== "nacos" && dbType !== "consul" && dbType !== "hbase" && dbType !== "zookeeper";
+ return dbType !== "nacos" && dbType !== "consul" && dbType !== "hbase" && dbType !== "zookeeper" && dbType !== "mq" && dbType !== "mqtt";
}
/**
diff --git a/issue-assets/issue-8415-kafka-context-menu-after.png b/issue-assets/issue-8415-kafka-context-menu-after.png
new file mode 100644
index 0000000000..3d69a914ae
Binary files /dev/null and b/issue-assets/issue-8415-kafka-context-menu-after.png differ
diff --git a/issue-assets/issue-8415-kafka-context-menu-before.png b/issue-assets/issue-8415-kafka-context-menu-before.png
new file mode 100644
index 0000000000..4a6f1b92f2
Binary files /dev/null and b/issue-assets/issue-8415-kafka-context-menu-before.png differ