feat(objects): show functions and procedures in sidebar tree

Add list_objects support for agent-driven databases (Dameng, Oracle, etc.)
and ExternalDriver plugin connections. SQL Server dbo schema now uses
listObjects to display grouped object nodes including routines.

- Add list_objects RPC to JDBC agent plugin
- Add extract_agent and ExternalDriver branches in list_objects_core
- Add get_object_source support for agent connections
- Click function/procedure nodes to view source via object browser
- Fix duplicate tree node IDs when same name exists as view and function
This commit is contained in:
t8y2
2026-05-15 13:02:19 +08:00
parent c8ba3dad69
commit c2da1f866c
7 changed files with 151 additions and 36 deletions
+19 -1
View File
@@ -322,6 +322,8 @@ function runRowClickAction() {
const action = treeNodeRowAction(node.type, canExpand.value);
if (action === "open-data") {
openData();
} else if (node.type === "procedure" || node.type === "function") {
void viewObjectSource();
} else if (node.type === "saved-sql-file") {
openSavedSqlFile();
} else if (action === "toggle") {
@@ -575,7 +577,23 @@ function buildDropObjectSql(): string {
}
function viewObjectSource() {
void openObjectBrowser();
const node = props.node;
if (!node.connectionId || !node.database) return;
const objectType = node.type === "procedure" ? "PROCEDURE" : "FUNCTION";
const schema = node.schema || node.database;
connectionStore
.ensureConnected(node.connectionId)
.then(() => {
connectionStore.activeConnectionId = node.connectionId!;
return api.getObjectSource(node.connectionId!, node.database!, schema, node.label, objectType as any);
})
.then((result) => {
const tabId = queryStore.createTab(node.connectionId!, node.database!, node.label);
queryStore.updateSql(tabId, result.source);
})
.catch((e: any) => {
toast(e?.message || String(e), 5000);
});
}
function requestDropObject() {