{"record":{"id":"f734a3b41575525e","repo":"t8y2/dbx","slug":"object-source-is-not-supported-for-s","errorCode":null,"errorMessage":"object source is not supported for %s","messagePattern":"object source is not supported for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":4434,"sourceCode":"WHERE s.DB_ID = CURRENT_DB_ID\n  AND UPPER(s.SCHEMA_NAME) = UPPER(?) AND UPPER(k.PACK_NAME) = UPPER(?)`, []any{schema, name}, nil\n\tcase \"TYPE\":\n\t\treturn `\nSELECT COALESCE(TO_CHAR(u.SPEC), '')\nFROM ALL_TYPES u\nJOIN ALL_SCHEMAS s ON s.DB_ID = u.DB_ID AND s.SCHEMA_ID = u.SCHEMA_ID\nWHERE s.DB_ID = CURRENT_DB_ID\n  AND UPPER(s.SCHEMA_NAME) = UPPER(?) AND UPPER(u.TYPE_NAME) = UPPER(?)`, []any{schema, name}, nil\n\tcase \"TYPE BODY\", \"TYPE_BODY\":\n\t\treturn `\nSELECT COALESCE(TO_CHAR(u.BODY), '')\nFROM ALL_TYPES u\nJOIN ALL_SCHEMAS s ON s.DB_ID = u.DB_ID AND s.SCHEMA_ID = u.SCHEMA_ID\nWHERE s.DB_ID = CURRENT_DB_ID\n  AND UPPER(s.SCHEMA_NAME) = UPPER(?) AND UPPER(u.TYPE_NAME) = UPPER(?)\n  AND u.BODY IS NOT NULL`, []any{schema, name}, nil\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"object source is not supported for %s\", objectType)\n\t}\n}\n\nfunc (s *server) buildTableDDL(schema, table string) (string, error) {\n\tcolumns, err := s.getColumns(schema, table)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(columns) == 0 {\n\t\treturn \"\", fmt.Errorf(\"table not found: %s.%s\", schema, table)\n\t}\n\tmetadata, err := s.tableMetadata(schema, table)\n\tif err != nil {\n\t\tif !isXuguMetadataAccessError(err) {\n\t\t\treturn \"\", err\n\t\t}\n\t\tmetadata = xuguTableMetadata{}\n\t}","sourceCodeStart":4416,"sourceCodeEnd":4452,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L4416-L4452","documentation":"The object-source resolver switches on objectType and has SQL for TABLE/VIEW/SYNONYM/TRIGGER/PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY/TYPE/TYPE BODY. Any other objectType string falls into the default case and throws this error: the driver simply has no catalog query to fetch source for that object type.","triggerScenarios":"Calling the object-source/DDL extraction API with objectType values outside the supported switch — e.g. 'INDEX', 'SEQUENCE', 'MATERIALIZED VIEW', a lowercase or otherwise misspelled type string, or an internal type code.","commonSituations":"Typo in the type name ('PROCEDURES' vs 'PROCEDURE'); requesting source for object kinds the driver does not support yet; passing a user-supplied type string through without validation; case or spacing variants not covered by the switch.","solutions":["Use one of the supported type strings exactly: TABLE, VIEW, SYNONYM, TRIGGER, PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, TYPE, TYPE BODY.","Validate/normalize the objectType before calling; map unsupported kinds to the closest supported one or skip them.","For INDEX/SEQUENCE or other unsupported kinds, fetch their definitions directly from the XuguDB catalog with your own query.","If the type should be supported, file/patch the driver to add a case for it."],"exampleFix":"// before\nsrc, _, err := getSourceFor(\"app\", \"SEQ_ORDERS\", \"SEQUENCE\") // unsupported\n\n// after (supported kind)\nsrc, _, err := getSourceFor(\"app\", \"PKG_ORDERS\", \"PACKAGE BODY\")","handlingStrategy":"validation","validationCode":"var supported = map[string]bool{\"TABLE\":true,\"VIEW\":true,\"SYNONYM\":true,\"TRIGGER\":true,\"PROCEDURE\":true,\"FUNCTION\":true,\"PACKAGE\":true,\"PACKAGE BODY\":true,\"TYPE\":true,\"TYPE BODY\":true}\nif !supported[strings.ToUpper(strings.TrimSpace(objectType))] {\n    return fmt.Errorf(\"object type %q is not supported for source extraction\", objectType)\n}","typeGuard":null,"tryCatchPattern":"if strings.HasPrefix(err.Error(), \"object source is not supported for\") { return skipUnsupportedObject(objectType) }","preventionTips":["Whitelist supported object types before calling source-extraction APIs.","Normalize type strings (upper-case, trim) coming from user input.","Keep a mapping table of object kinds your tooling can and cannot reconstruct."],"tags":["database","ddl","unsupported-type","xugu"],"backgroundTag":"unsupported-object-type","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}