t8y2/dbx · error

sequence name is required

Error message

sequence name is required

What it means

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.

Source

Thrown at agents/drivers/xugu/main.go:3434

	return result, rows.Err()
}

// resolveCatalogSequenceName follows the same exact-case-first policy used by
// table DDL export. A case-insensitive lookup is only safe when it resolves to
// one catalog object; selecting the first row would export a different quoted
// sequence when catalog objects differ only by case.
func (s *server) resolveCatalogSequenceName(schema, name string) (string, string, error) {
	schema = strings.TrimSpace(schema)
	name = strings.TrimSpace(name)
	if schema == "" {
		current, err := s.currentSchema()
		if err != nil {
			return "", "", err
		}
		schema = current
	}
	if name == "" {
		return "", "", errors.New("sequence name is required")
	}
	candidates, err := s.catalogSequenceNameCandidates(xuguCatalogSequenceNameQuery(schema, name, false))
	if err != nil {
		return "", "", err
	}
	if len(candidates) > 0 {
		return selectXuguCatalogSequenceName(schema, name, candidates)
	}

	candidates, err = s.catalogSequenceNameCandidates(xuguCatalogSequenceNameQuery(schema, name, true))
	if err != nil {
		return "", "", err
	}
	return selectXuguCatalogSequenceName(schema, name, candidates)
}

func xuguSequenceMetadataQuery(schema, name string) string {
	return `

View on GitHub (pinned to c0390bff16)

Solutions

  1. Supply a non-empty sequence name
  2. Validate the name before calling the resolution API
  3. Verify the request payload carries the sequence identifier

Example fix

// before
resolveCatalogSequence(schema, "")
// after
if seqName == "" { return errors.New("sequence name is required") }
resolveCatalogSequence(schema, seqName)
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(sequenceName) == "" {
    return fmt.Errorf("sequence name is required")
}

Type guard

func hasSequenceName(name string) bool {
    return strings.TrimSpace(name) != ""
}

Try / catch

seq, schema, err := s.resolveCatalogSequence(schema, name)
if err != nil {
    if err.Error() == "sequence name is required" {
        return "", "", fmt.Errorf("invalid request: %w", err)
    }
    return "", "", err
}

Prevention

When it happens

Trigger: 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).

Common situations: Requests where the sequence identifier field was omitted, or code that defaulted an optional identifier to an empty string.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/e4c50903623bfca2. Report an issue: GitHub.