{"record":{"id":"603b6c1f213e8d52","repo":"t8y2/dbx","slug":"object-source-is-not-supported","errorCode":null,"errorMessage":"Object source is not supported","messagePattern":"Object source is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java","lineNumber":20,"sourceCode":"\nimport java.sql.Connection;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\npublic abstract class BaseDatabaseAgent implements DatabaseAgent {\n    @Override\n    public List<ObjectInfo> listObjects(String schema) {\n        List<ObjectInfo> result = new ArrayList<>();\n        for (TableInfo table : listTables(schema)) {\n            result.add(new ObjectInfo(table.getName(), table.getTable_type(), schema, table.getComment()));\n        }\n        return result;\n    }\n\n    @Override\n    public ObjectSource getObjectSource(String schema, String name, String objectType) {\n        throw new UnsupportedOperationException(\"Object source is not supported\");\n    }\n\n    @Override\n    public CompletionAssistantResponse completionAssistantSearch(CompletionAssistantRequest request) {\n        throw new UnsupportedOperationException(\"Completion assistant search is not supported by this agent\");\n    }\n\n    @Override\n    public String getTableDdl(String schema, String table) {\n        List<IndexInfo> indexes;\n        try {\n            indexes = listIndexes(schema, table);\n        } catch (RuntimeException e) {\n            indexes = Collections.emptyList();\n        }\n\n        List<ForeignKeyInfo> foreignKeys;\n        try {","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/common/src/main/java/com/dbx/agent/BaseDatabaseAgent.java#L2-L38","documentation":"BaseDatabaseAgent provides a default getObjectSource implementation that deliberately throws UnsupportedOperationException: this base agent (or the driver it wraps) cannot retrieve DDL/source text for database objects. It is an intentional capability gap, not a defect.","triggerScenarios":"Calling getObjectSource(schema, name, objectType) on an agent subclass that does not override it (a driver lacking source extraction support).","commonSituations":"Generic metadata tooling calling getObjectSource uniformly across all database agents; a driver migrated to the base class where source retrieval was previously handled by a specialized subclass.","solutions":["Use an agent subclass that overrides getObjectSource for your database","Skip source retrieval when the agent doesn't support it (catch or feature-check)","Implement getObjectSource in your custom agent using driver-specific catalog queries","Request or contribute support for this driver's object-source extraction"],"exampleFix":"// before\nString ddl = agent.getObjectSource(schema, table, \"TABLE\"); // throws\n// after\nString ddl = agent.supportsObjectSource()\n    ? agent.getObjectSource(schema, table, \"TABLE\")\n    : null;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    ObjectSource src = agent.getObjectSource(schema, name, objectType);\n} catch (UnsupportedOperationException e) {\n    ObjectSource src = null; // capability not available on this agent\n}","preventionTips":["Maintain a capability matrix of which agent implementations support object source","Feature-detect before showing source-dependent UI","Prefer specialized agent subclasses for DDL/source retrieval","Handle UnsupportedOperationException uniformly across metadata APIs"],"tags":["jdbc","unsupported-operation","metadata"],"backgroundTag":"unsupported-operation","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}