{"record":{"id":"ddb409c187446af4","repo":"t8y2/dbx","slug":"type-not-found-s-s","errorCode":null,"errorMessage":"type not found: %s.%s","messagePattern":"type not found: (.+?)\\.(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/type_members.go","lineNumber":252,"sourceCode":"\t\t}\n\t\tvar kind sql.NullInt64\n\t\tvar spec sql.NullString\n\t\tif err := rows.Scan(&kind, &spec); err != nil {\n\t\t\treturn xuguTypeDefinition{}, false, err\n\t\t}\n\t\treturn xuguTypeDefinition{Kind: int(kind.Int64), Spec: spec.String}, true, nil\n\t}\n\tif definition, found, err := query(xuguObjectTypeSQL, schema, typeName); err != nil || found {\n\t\treturn definition, err\n\t}\n\tdefinition, found, err := query(xuguObjectTypeCaseFoldedSQL, schema, typeName, schema, typeName)\n\tif err != nil {\n\t\treturn xuguTypeDefinition{}, err\n\t}\n\tif found {\n\t\treturn definition, nil\n\t}\n\treturn xuguTypeDefinition{}, fmt.Errorf(\"type not found: %s.%s\", schema, typeName)\n}\n\n// Some current XuguDB builds expose ALL_TYPES but do not publish the auxiliary\n// ALL_TYPE_ATTRS / ALL_TYPE_METHODS views that older DBeaver integrations use.\n// In that case the type specification is still authoritative and is the only\n// low-privilege metadata source available. Parse only its top-level object\n// declaration; this fallback never inspects or guesses from a TYPE BODY.\nfunc parseXuguObjectTypeAttributes(spec string) []xuguTypeAttribute {\n\tattributes, _ := parseXuguObjectTypeMembers(spec)\n\treturn attributes\n}\n\nfunc parseXuguObjectTypeMethods(spec string) []xuguTypeMethod {\n\t_, methods := parseXuguObjectTypeMembers(spec)\n\treturn methods\n}\n\nfunc parseXuguObjectTypeMembers(spec string) ([]xuguTypeAttribute, []xuguTypeMethod) {","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/type_members.go#L234-L270","documentation":"xuguTypeDefinition resolves a user-defined type's definition (and later its attributes/methods) from metadata views. If the definition lookup finds no row for schema.typeName, it returns this error to completionAssistantSearchTypeMembers instead of an empty member list.","triggerScenarios":"Requesting type-member completion for schema.typeName where the ALL_TYPES-style lookup finds nothing: type name misspelled, wrong schema, type dropped, or the account cannot read the type's metadata row.","commonSituations":"SQL editor autocomplete on an OBJECT/ARRAY type with wrong casing or schema prefix, restricted metadata visibility for the current user, or referencing a type from an older XuguDB build where the view is unavailable.","solutions":["Confirm the type exists: query the type catalog for schema and exact type name.","Qualify with the correct schema and match stored casing.","Grant metadata read privileges to the connecting user.","Reconnect to pick up newly created types if the session predates the type."],"exampleFix":"// before\nxuguTypeDefinition(\"sales\", \"order_typ\") // actual name: ORDER_T\n// after\nxuguTypeDefinition(\"sales\", \"order_t\")","handlingStrategy":"validation","validationCode":"func typeExists(ctx context.Context, q Queryer, schema, typeName string) (bool, error) {\n\tvar n int\n\terr := q.QueryRowContext(ctx,\n\t\t\"SELECT COUNT(*) FROM all_types WHERE owner = ? AND type_name = ?\",\n\t\tschema, typeName).Scan(&n)\n\treturn n > 0, err\n}","typeGuard":null,"tryCatchPattern":"def, err := xuguTypeDefinition(schema, typeName)\nif err != nil {\n\tif strings.HasPrefix(err.Error(), \"type not found: \") {\n\t\treturn nil, fmt.Errorf(\"type %s.%s not visible; check name, schema and grants\", schema, typeName)\n\t}\n\treturn nil, err\n}","preventionTips":["Confirm exact type names in the type catalog before member completion.","Use schema-qualified names matching stored casing.","Re-grant metadata access when users report types \"missing\"."],"tags":["database","metadata","type-not-found"],"backgroundTag":"object-not-found","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"}