{"record":{"id":"e4c50903623bfca2","repo":"t8y2/dbx","slug":"sequence-name-is-required","errorCode":null,"errorMessage":"sequence name is required","messagePattern":"sequence name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":3434,"sourceCode":"\treturn result, rows.Err()\n}\n\n// resolveCatalogSequenceName follows the same exact-case-first policy used by\n// table DDL export. A case-insensitive lookup is only safe when it resolves to\n// one catalog object; selecting the first row would export a different quoted\n// sequence when catalog objects differ only by case.\nfunc (s *server) resolveCatalogSequenceName(schema, name string) (string, string, error) {\n\tschema = strings.TrimSpace(schema)\n\tname = strings.TrimSpace(name)\n\tif schema == \"\" {\n\t\tcurrent, err := s.currentSchema()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t\tschema = current\n\t}\n\tif name == \"\" {\n\t\treturn \"\", \"\", errors.New(\"sequence name is required\")\n\t}\n\tcandidates, err := s.catalogSequenceNameCandidates(xuguCatalogSequenceNameQuery(schema, name, false))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif len(candidates) > 0 {\n\t\treturn selectXuguCatalogSequenceName(schema, name, candidates)\n\t}\n\n\tcandidates, err = s.catalogSequenceNameCandidates(xuguCatalogSequenceNameQuery(schema, name, true))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\treturn selectXuguCatalogSequenceName(schema, name, candidates)\n}\n\nfunc xuguSequenceMetadataQuery(schema, name string) string {\n\treturn `","sourceCodeStart":3416,"sourceCodeEnd":3452,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L3416-L3452","documentation":"Returned by server.resolveCatalogSequenceName in the xugu driver when the sequence name argument is blank after trimming (schema defaults to the current schema if omitted, but the name has no default). Sequence DDL export cannot proceed without an object name, so the request is rejected before any catalog lookup.","triggerScenarios":"Calling the sequence catalog resolution path with an empty name string (schema may be defaulted to the current schema, but the name itself must be non-empty).","commonSituations":"Requests where the sequence identifier field was omitted, or code that defaulted an optional identifier to an empty string.","solutions":["Supply a non-empty sequence name","Validate the name before calling the resolution API","Verify the request payload carries the sequence identifier"],"exampleFix":"// before\nresolveCatalogSequence(schema, \"\")\n// after\nif seqName == \"\" { return errors.New(\"sequence name is required\") }\nresolveCatalogSequence(schema, seqName)","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(sequenceName) == \"\" {\n    return fmt.Errorf(\"sequence name is required\")\n}","typeGuard":"func hasSequenceName(name string) bool {\n    return strings.TrimSpace(name) != \"\"\n}","tryCatchPattern":"seq, schema, err := s.resolveCatalogSequence(schema, name)\nif err != nil {\n    if err.Error() == \"sequence name is required\" {\n        return \"\", \"\", fmt.Errorf(\"invalid request: %w\", err)\n    }\n    return \"\", \"\", err\n}","preventionTips":["Validate the sequence name is non-empty before catalog queries","Default schema but never default the object name itself"],"tags":["validation","xugu","catalog","sequence"],"backgroundTag":"missing-required-argument","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"}