feat: consolidate DM8 and DM8Oracle into single Dameng type + fixes#110
Merged
Conversation
Backend (Rust): - lib.rs: manage AppState directly, not Arc<AppState> (Tauri TypeId mismatch) - capabilities/sql.rs: 35 adapter arms for JdbcBridge/ClickHouse/HttpSql/Rqlite/Turso - capabilities/sql.rs: get_schema capped at 30 tables to prevent N+1 timeout on Oracle - capabilities/sql.rs: tool descriptions improved (list_tables for existence, get_schema for DDL) - jdbc_bridge/adapter.rs: spawn_blocking for pipe reads so tokio::time::timeout works - deps: data-studio-agent upgraded to v0.1.2 (self-healing, tool timeout, message ordering) Frontend (Vue/TS): - agent-message-bubble.vue: tool errors auto-expand, retry text shown inline - chat-panel.vue: removed floating status bar, cleaned up props - agentRuntime.ts: tool retry event handler with inline status - agentRuntime.ts: context-usage tracking wired - useChatAgent.ts: system prompt hardened with tool usage rules - agentApi.ts: onAgentLoopToolRetry event - dataStudioStore.ts: session tracking fields (startTime, tokenUsage, activeTool)
Root cause: JDBC getCatalogs() returns empty for Oracle, so the
frontend database selector had no options and the tree was empty.
Changes:
- jdbc-bridge: Add Oracle fallback in MetadataProvider.listDatabases()
using SYS_CONTEXT('USERENV', 'CON_NAME') and v queries when
getCatalogs() returns empty
- frontend: Add defensive fallback in databaseStore.fetchDatabases()
to synthesize a database entry from the connection's configured
database when the backend returns an empty list
Merge the two separate database type variants (DM8 for MySQL-wire protocol, DM8Oracle for JDBC bridge) into a single Dameng variant that routes exclusively through the JDBC bridge using the official Dameng JDBC driver (com.dameng:DmJdbcDriver8). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Collapse DM8 and DM8ORACLE enum values into DAMENG. Update connection form, database icons, SQL formatter dialect (plsql), data studio agent sources, SSL labels, and translation keys. Remove unused dm8oracle-logo.svg. Preserve isConnected across fetchConnections for accurate active-session display. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… resilient Add split_sql_statements() to the JDBC bridge adapter so multi-statement SQL (e.g. CREATE TABLE; COMMENT ON) is executed individually. The Dameng JDBC driver rejects ;-separated statements in a single execute() call. Also make list_connections fallback to an empty list instead of propagating store errors. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…lumn in query results Make supportsSchemas data-driven (checks actual schema data) instead of hardcoded to PostgreSQL and SQL Server, so Dameng/Oracle/DB2 users can browse schemas. Show the DataGrid Actions column (copy, edit, delete) in query result panels, not just table views. Add synthetic database entry when listDatabases returns empty. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Move Dameng from MySQL-wire to JDBC bridge table. Rename DM8 to Dameng to be version-agnostic. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Accumulate rows_affected across DML statements and preserve the last SELECT result. Document that multi-statement execution is in autocommit mode (no transaction wrapping). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The DM8 connection was previously split into two separate types:
DM8(using MySQL wire protocol via the Rust MySQL adapter) andDM8Oracle(using JDBC bridge with the Dameng JDBC driver). This was confusing — users had to know which compatibility mode their server was running, and the MySQL-wire path had zero Dameng-specific code. The official Dameng JDBC driver (DmJdbcDriver8) handles all connection modes through a single protocol, so we now use it exclusively.Also fixes several issues discovered while testing DM8 connectivity end-to-end.
Changes
DM8 Type Consolidation (backend)
DatabaseType::DM8andDatabaseType::DM8Oracleinto a singleDatabaseType::DamengCoreDatabaseType::DM8Oracle— it's not a core adapter typeDmJdbcDriver(nonexistent on Maven Central) toDmJdbcDriver8(latest: 8.1.5.45)dm,dm8,dm8_oracle,dm8oracle) still resolve toDamengDM8 Type Consolidation (frontend)
DM8,DM8ORACLE) into one (DAMENG)plsqldialect (matches the JDBC bridge's Oracle-compatible mode)dm8oracle-logo.svgassetJDBC Bridge: Multi-Statement SQL Splitting
The Dameng JDBC driver rejects
;-separated statements in a singleexecute()call. When the data studio agent generates SQL like:...the driver returns "Syntax error" on the second statement. Added
split_sql_statements()in the JDBC bridge adapter that splits multi-statement SQL on;(respecting string literals, quoted identifiers, and comments) and executes each statement individually via the bridge.JDBC Bridge: list_connections Resilience
sqlkit__list_connectionswas failing intermittently during parallel tool calls becauseTauriStoreReaderpropagated errors from the Tauri plugin store directly. Changed to return an empty connection list on store errors instead of failing, so the agent can continue working.Database Browser: Schema Support for All Schema-Aware Databases
The
supportsSchemasflag was hardcoded to only PostgreSQL and SQL Server, hiding the schema selector for Dameng (12 schemas available), Oracle, DB2, H2, and other JDBC databases with schemas. Changed to a data-driven check — iffetchSchemasreturns any schemas, the schema selector appears and tables are grouped under their schema. Falls back to flat table listing for MySQL-family databases that don't have schemas.Database Browser: Synthetic Entry for Single-Database Systems
Dameng, Oracle, and similar databases don't support listing multiple databases —
listDatabasesreturns empty. When no current database is known, the store now creates a synthetic entry using the connection name so the tree structure and database selector still work.DataGrid: Actions Column in Query Results
The Actions column (copy row, edit, delete, export) was gated by
v-if="connectionId && tableName", hiding it in query result panels wheretableNameis never set. Changed tov-if="connectionId"so the actions menu is available for ad-hoc query results too.Connection State Preservation Across Page Navigation
The Connections page calls
fetchConnections()on mount, which replaces the entire connections array with data from the backend config store. The backend doesn't track runtime connection state (isConnected), so all connections appeared disconnected even when actively connected in other tabs.fetchConnectionsnow preservesisConnectedfrom existing store entries.Testing