{"record":{"id":"c1ce7aa96e23196c","repo":"t8y2/dbx","slug":"schema-and-type-name-are-required-c1ce7a","errorCode":null,"errorMessage":"schema and type name are required","messagePattern":"schema and type name are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/vastbase-go/vastbase_metadata.go","lineNumber":599,"sourceCode":"\t\trangeMultirange: fmt.Sprintf(`SELECT mt.typname\nFROM %s r\nJOIN %s mt ON mt.oid = r.rngmultitypid\nWHERE r.rngtypid = %%d`, rangeTable, typeTable),\n\t\tcollationName: fmt.Sprintf(`SELECT quote_ident(ncl.nspname) || '.' || quote_ident(cl.collname) FROM %s cl JOIN %s ncl ON ncl.oid = cl.collnamespace WHERE cl.oid = %%d`, collationTable, namespaceTable),\n\t}\n}\n\n// getTypeDetails returns read-only details of a user-defined type. MySQL\n// compatibility mode is explicitly unsupported instead of running PostgreSQL\n// catalog SQL against a MySQL-mode server.\nfunc (s *server) getTypeDetails(schema, name string) (*customTypeDetails, error) {\n\tif s.mode.mysqlCompat {\n\t\treturn nil, errors.New(\"type details are not supported in MySQL compatibility mode\")\n\t}\n\tschema = strings.TrimSpace(schema)\n\tname = strings.TrimSpace(name)\n\tif schema == \"\" || name == \"\" {\n\t\treturn nil, errors.New(\"schema and type name are required\")\n\t}\n\tif isSystemSchema(schema) {\n\t\treturn nil, fmt.Errorf(\"system schema %s is not supported for custom type details\", schema)\n\t}\n\tcatalog := \"sys_catalog\"\n\tif s.mode.postgresCatalog {\n\t\tcatalog = \"pg_catalog\"\n\t}\n\tprefix := catalogPrefix(catalog)\n\tqueries := customTypeCatalogQueriesFor(catalog, prefix, schema, name)\n\n\trows, err := s.metadataQuery(queries.general)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to locate custom type %s.%s: %w\", schema, name, err)\n\t}\n\tdefer rows.Close()\n\tif !rows.Next() {\n\t\tif err := rows.Err(); err != nil {","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/vastbase-go/vastbase_metadata.go#L581-L617","documentation":"Returned by server.getTypeDetails in the vastbase-go driver when either the schema or type name argument is blank after trimming. Custom type detail lookup needs both parts to form a catalog-qualified name, so blank input is rejected before any catalog query runs.","triggerScenarios":"Calling the type-details metadata RPC with empty or whitespace-only schema and/or name parameters.","commonSituations":"Client UI sending blank fields from an unselected type in the sidebar; programmatic callers passing empty strings when the type name failed to resolve upstream; whitespace-padded values that trim to empty.","solutions":["Populate both schema and name (non-empty after trim) before calling the type-details RPC","Resolve the type from a prior list-types call instead of hardcoding empty values","Validate parameters client-side and skip the call when they are blank"],"exampleFix":"// before\nagent.GetTypeDetails(ctx, \"\", \"\")\n// after\nif strings.TrimSpace(schema) == \"\" || strings.TrimSpace(name) == \"\" { return errors.New(\"schema and type name are required\") }\nagent.GetTypeDetails(ctx, schema, name)","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(schema) == \"\" || strings.TrimSpace(name) == \"\" { return errors.New(\"schema and type name are required\") }","typeGuard":"func validTypeRef(schema, name string) bool { return strings.TrimSpace(schema) != \"\" && strings.TrimSpace(name) != \"\" }","tryCatchPattern":"d, err := agent.GetTypeDetails(ctx, schema, name)\nif err != nil && strings.Contains(err.Error(), \"required\") { return ErrInvalidTypeRef }","preventionTips":["Validate identifiers after trimming whitespace","Resolve types from a list-types call rather than free-form input","Reject blank form fields before issuing RPCs"],"tags":["validation","parameters","metadata"],"backgroundTag":"missing-required-parameter","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"}