t8y2/dbx · error

object source is not supported for %s

Error message

object source is not supported for %s

What it means

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.

Source

Thrown at agents/drivers/xugu/main.go:4434

WHERE s.DB_ID = CURRENT_DB_ID
  AND UPPER(s.SCHEMA_NAME) = UPPER(?) AND UPPER(k.PACK_NAME) = UPPER(?)`, []any{schema, name}, nil
	case "TYPE":
		return `
SELECT COALESCE(TO_CHAR(u.SPEC), '')
FROM ALL_TYPES u
JOIN ALL_SCHEMAS s ON s.DB_ID = u.DB_ID AND s.SCHEMA_ID = u.SCHEMA_ID
WHERE s.DB_ID = CURRENT_DB_ID
  AND UPPER(s.SCHEMA_NAME) = UPPER(?) AND UPPER(u.TYPE_NAME) = UPPER(?)`, []any{schema, name}, nil
	case "TYPE BODY", "TYPE_BODY":
		return `
SELECT COALESCE(TO_CHAR(u.BODY), '')
FROM ALL_TYPES u
JOIN ALL_SCHEMAS s ON s.DB_ID = u.DB_ID AND s.SCHEMA_ID = u.SCHEMA_ID
WHERE s.DB_ID = CURRENT_DB_ID
  AND UPPER(s.SCHEMA_NAME) = UPPER(?) AND UPPER(u.TYPE_NAME) = UPPER(?)
  AND u.BODY IS NOT NULL`, []any{schema, name}, nil
	default:
		return "", nil, fmt.Errorf("object source is not supported for %s", objectType)
	}
}

func (s *server) buildTableDDL(schema, table string) (string, error) {
	columns, err := s.getColumns(schema, table)
	if err != nil {
		return "", err
	}
	if len(columns) == 0 {
		return "", fmt.Errorf("table not found: %s.%s", schema, table)
	}
	metadata, err := s.tableMetadata(schema, table)
	if err != nil {
		if !isXuguMetadataAccessError(err) {
			return "", err
		}
		metadata = xuguTableMetadata{}
	}

View on GitHub (pinned to c0390bff16)

Solutions

  1. Use one of the supported type strings exactly: TABLE, VIEW, SYNONYM, TRIGGER, PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY, TYPE, TYPE BODY.
  2. Validate/normalize the objectType before calling; map unsupported kinds to the closest supported one or skip them.
  3. For INDEX/SEQUENCE or other unsupported kinds, fetch their definitions directly from the XuguDB catalog with your own query.
  4. If the type should be supported, file/patch the driver to add a case for it.

Example fix

// before
src, _, err := getSourceFor("app", "SEQ_ORDERS", "SEQUENCE") // unsupported

// after (supported kind)
src, _, err := getSourceFor("app", "PKG_ORDERS", "PACKAGE BODY")
Defensive patterns

Strategy: validation

Validate before calling

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}
if !supported[strings.ToUpper(strings.TrimSpace(objectType))] {
    return fmt.Errorf("object type %q is not supported for source extraction", objectType)
}

Try / catch

if strings.HasPrefix(err.Error(), "object source is not supported for") { return skipUnsupportedObject(objectType) }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/f734a3b41575525e. Report an issue: GitHub.