{"record":{"id":"f579e361d6ab59cb","repo":"t8y2/dbx","slug":"synonym-name-is-required","errorCode":null,"errorMessage":"synonym name is required","messagePattern":"synonym name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":3616,"sourceCode":"\t\t\"editable\":    false,\n\t}, nil\n}\n\n// resolveCatalogSynonym applies exact matching before a case-insensitive\n// fallback. This preserves quoted identifiers and refuses an ambiguous lookup\n// instead of silently generating DDL for a different alias.\nfunc (s *server) resolveCatalogSynonym(schema, name string) (xuguCatalogSynonym, 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 xuguCatalogSynonym{}, err\n\t\t}\n\t\tschema = current\n\t}\n\tif name == \"\" {\n\t\treturn xuguCatalogSynonym{}, errors.New(\"synonym name is required\")\n\t}\n\n\tcandidates, err := s.catalogSynonymCandidates(xuguCatalogSynonymQuery(schema, name, false))\n\tif err != nil {\n\t\treturn xuguCatalogSynonym{}, err\n\t}\n\tif len(candidates) == 0 {\n\t\tcandidates, err = s.catalogSynonymCandidates(xuguCatalogSynonymQuery(schema, name, true))\n\t\tif err != nil {\n\t\t\treturn xuguCatalogSynonym{}, err\n\t\t}\n\t}\n\treturn selectXuguCatalogSynonym(schema, name, candidates)\n}\n\nfunc xuguCatalogSynonymQuery(schema, name string, caseInsensitive bool) string {\n\tschemaExpr := quoteStringLiteral(schema)\n\tnameExpr := quoteStringLiteral(name)","sourceCodeStart":3598,"sourceCodeEnd":3634,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L3598-L3634","documentation":"Returned by server.resolveCatalogSynonym in the xugu driver when the synonym name argument is blank after trimming (schema defaults to the current schema). Synonym DDL export needs a concrete object name; the request is rejected before the exact-case/case-insensitive catalog resolution runs.","triggerScenarios":"Calling the synonym catalog resolution path with an empty name string; the schema may default to the current schema but the name must be provided.","commonSituations":"Tooling that lists synonyms without filtering by a specific name, or requests missing the synonym identifier field.","solutions":["Supply a non-empty synonym name","Validate the name before calling the resolution API","Ensure the synonym identifier is present in the request"],"exampleFix":"// before\nresolveCatalogSynonym(schema, \"\")\n// after\nif synName == \"\" { return errors.New(\"synonym name is required\") }\nresolveCatalogSynonym(schema, synName)","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(synonymName) == \"\" {\n    return fmt.Errorf(\"synonym name is required\")\n}","typeGuard":"func hasSynonymName(name string) bool {\n    return strings.TrimSpace(name) != \"\"\n}","tryCatchPattern":"syn, err := s.resolveCatalogSynonym(schema, name)\nif err != nil {\n    if err.Error() == \"synonym name is required\" {\n        return xuguCatalogSynonym{}, fmt.Errorf(\"invalid request: %w\", err)\n    }\n    return xuguCatalogSynonym{}, err\n}","preventionTips":["Require a synonym name filter for synonym catalog requests","Trim whitespace on identifiers sourced from user input"],"tags":["validation","xugu","catalog","synonym"],"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-14T05:17:10.506Z"}