{"record":{"id":"984324c296f752cd","repo":"t8y2/dbx","slug":"table-is-required-984324","errorCode":null,"errorMessage":"table is required","messagePattern":"table is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":2832,"sourceCode":"\t\t\titem.CharacterMaximumLength = &value\n\t\t}\n\t\tresult = append(result, item)\n\t}\n\treturn emptyIfNil(result), nil\n}\n\nfunc (s *server) fallbackTableIdentity(schema, table string) (string, string, error) {\n\tschema = strings.TrimSpace(schema)\n\tif schema == \"\" {\n\t\tvar err error\n\t\tschema, err = s.currentSchema()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t}\n\ttable = strings.TrimSpace(table)\n\tif table == \"\" {\n\t\treturn \"\", \"\", errors.New(\"table is required\")\n\t}\n\treturn schema, table, nil\n}\n\nfunc isXuguTableNotFoundError(err error) bool {\n\treturn strings.Contains(strings.ToUpper(err.Error()), \"TABLE NOT FOUND:\")\n}\n\nfunc (s *server) primaryKeyColumns(schema, table string) (map[string]bool, error) {\n\trows, err := s.queryRows(xuguTableCatalogQuery(xuguPrimaryKeyColumnsSQL, schema, table), nil)\n\tif err != nil {\n\t\tif isXuguMetadataUnavailableError(err) {\n\t\t\treturn map[string]bool{}, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tdefer s.closeRows(rows)\n\tresult := map[string]bool{}","sourceCodeStart":2814,"sourceCodeEnd":2850,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L2814-L2850","documentation":"A resolve helper (resolving schema/table pairs, e.g. for table-level metadata or DDL routing) trims the table name and rejects empty values with this error. Schema may be defaulted, but a table name is mandatory.","triggerScenarios":"Calling a table-scoped RPC with an empty or whitespace-only table parameter; upstream resolution left the table unset; identifier parsing produced an empty table part.","commonSituations":"Sidebar/tooling invoking table operations before a table is selected; programmatic callers passing \"\" for unqualified object references; copy/paste or interpolation bugs producing blank names.","solutions":["Supply a non-empty table name in the RPC params","Validate the table identifier client-side before the call","Fix upstream resolution so the table name is populated from a prior list-tables result"],"exampleFix":"// before\nagent.GetTableMetadata(ctx, schema, \"\")\n// after\nif strings.TrimSpace(table) == \"\" { return errors.New(\"table is required\") }\nagent.GetTableMetadata(ctx, schema, table)","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(table) == \"\" { return errors.New(\"table is required\") }","typeGuard":"func validTableRef(table string) bool { return strings.TrimSpace(table) != \"\" }","tryCatchPattern":"meta, err := agent.GetTableMetadata(ctx, schema, table)\nif err != nil && strings.Contains(err.Error(), \"table is required\") { return ErrTableRefMissing }","preventionTips":["Require an explicit table selection before table-scoped RPCs","Trim identifiers and reject empties client-side","Parse qualified names defensively so table never resolves empty"],"tags":["validation","parameters","table"],"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"}