{"record":{"id":"e756cd256ee09ff1","repo":"ory/hydra","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/popx/match.go","lineNumber":75,"sourceCode":"\t\t// A special case where autocommit group moves forward to the 3rd index.\n\t\tautocommit = true\n\t\tdbType = \"all\"\n\t} else if m[dbTypeIdx] == \"\" {\n\t\tdbType = \"all\"\n\t} else {\n\t\tdbType = strings.TrimPrefix(m[dbTypeIdx], \".\")\n\t\t// The commercial package registers this dialect from init(), but\n\t\t// migration boxes can be constructed before that package enters the\n\t\t// import graph. Canonicalize both accepted spellings independently of\n\t\t// registration so migration selection is deterministic in every build.\n\t\tswitch dbType {\n\t\tcase dbal.DriverYugabyteDB, \"yugabytedb\":\n\t\t\tdbType = dbal.DriverYugabyteDB\n\t\tdefault:\n\t\t\tdbType = pop.CanonicalDialect(dbType)\n\t\t}\n\t\tif dbType != dbal.DriverYugabyteDB && !pop.DialectSupported(dbType) {\n\t\t\treturn nil, errors.Wrapf(errUnsupportedMigrationDialect, \"%s\", dbType)\n\t\t}\n\t}\n\n\tif m[typeIdx] == \"fizz\" && dbType != \"all\" {\n\t\treturn nil, errors.Errorf(\"invalid database type %q, expected \\\"all\\\" because fizz is database type independent\", dbType)\n\t}\n\n\tif m[autocommitIdx] == \".autocommit\" {\n\t\tautocommit = true\n\t} else if m[autocommitIdx] != \"\" {\n\t\treturn nil, errors.Errorf(\"invalid autocommit flag %q\", m[autocommitIdx])\n\t}\n\n\treturn &match{\n\t\tVersion:    m[versionIdx],\n\t\tName:       m[nameIdx],\n\t\tDBType:     dbType,\n\t\tAutocommit: autocommit,","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/popx/match.go#L57-L93","documentation":"When parsing a migration filename, parseMigrationFilename canonicalizes the dialect segment and rejects dialects the build does not support (oryx/popx/match.go:74). It wraps errUnsupportedMigrationDialect (\"unsupported dialect\") with the offending dialect name via errors.Wrapf, so the rendered message is just the dialect string. This prevents migrations written for unregistered dialects from being loaded.","triggerScenarios":"A migration file like 20210101000000_name.pgsql.up.sql (or any dialect segment) whose dbType, after canonicalization, is not YugabyteDB and fails pop.DialectSupported(dbType) — e.g. a dialect never registered (no driver import or commercial init()) or a typo in the dialect segment.","commonSituations":"Embedding migration files from a project that targets a dialect the consuming binary does not import; forgetting to import the enterprise package that registers yugabyte/yugabytedb (though those are canonicalized unconditionally); typos like .posgres. or .mysqlite. in filenames.","solutions":["Fix the dialect segment in the migration filename to a supported one (postgres, cockroach, mysql, sqlite3, all)","Ensure the package that registers the dialect is imported into the binary's import graph","Check for typos in the filename dialect segment"],"exampleFix":"// before (unsupported/typo'd dialect)\n20210101000000_add_table.posgres.up.sql\n// after\n20210101000000_add_table.postgres.up.sql","handlingStrategy":"validation","validationCode":"re := regexp.MustCompile(`^(\\d+)_([^.]+)(\\.[a-z0-9]+)?(\\.autocommit)?\\.(up|down)\\.(sql)$`)\nif !re.MatchString(filename) { return fmt.Errorf(\"bad migration filename %q\", filename) }\ndialect := extractDialect(filename)\nif !pop.DialectSupported(dialect) { return fmt.Errorf(\"unsupported dialect %q in %q\", dialect, filename) }","typeGuard":null,"tryCatchPattern":"m, err := parseMigrationFilename(name)\nif err != nil {\n    var wrapped interface{ Cause() error }\n    if errors.As(err, &cause) && errors.Is(cause, errUnsupportedMigrationDialect) { /* skip or fix */ }\n    return err\n}","preventionTips":["Only embed migration files whose dialects your binary actually imports/registers","Lint migration filenames in CI against MigrationFileRegexp and the supported dialect list","Avoid hand-editing dialect segments; generate filenames with tooling"],"tags":["migrations","database","dialect","file-naming"],"backgroundTag":"unsupported-dialect","analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}