{"record":{"id":"e428edbd7f1a4e0d","repo":"ory/hydra","slug":"unsupported-dialect","errorCode":null,"errorMessage":"unsupported dialect","messagePattern":"unsupported dialect","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"oryx/popx/match.go","lineNumber":17,"sourceCode":"// Copyright © 2024 Ory Corp\n// SPDX-License-Identifier: Apache-2.0\n\npackage popx\n\nimport (\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/pkg/errors\"\n\n\t\"github.com/ory/pop/v6\"\n\n\t\"github.com/ory/x/dbal\"\n)\n\nvar errUnsupportedMigrationDialect = errors.New(\"unsupported dialect\")\n\nvar MigrationFileRegexp = regexp.MustCompile(\n\t`^(\\d+)_([^.]+)(\\.[a-z0-9]+)?(\\.autocommit)?\\.(up|down)\\.(sql)$`,\n)\n\nconst (\n\t// Human-readable constants for the regex capture groups\n\tversionIdx = iota + 1\n\tnameIdx\n\tdbTypeIdx\n\tautocommitIdx\n\tdirectionIdx\n\ttypeIdx\n)\n\n// match holds the information parsed from a migration filename.\ntype match struct {\n\tVersion    string","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/popx/match.go#L1-L35","documentation":"errUnsupportedMigrationDialect is the sentinel error returned by parseMigrationFilename when a migration file's filename encodes a database dialect that is not supported. Callers use errors.Is to distinguish 'unknown dialect' (skippable, non-fatal) from genuine filename parse errors.","triggerScenarios":"Scanning a migrations directory where a file name carries a dialect suffix or pattern that maps to a dbType for which pop.DialectSupported returns false (and which is not YugabyteDB), as checked in match.go:75; also surfaces when migration_box.go iterates files and calls parseMigrationFilename on files with an unrecognized dialect component.","commonSituations":"Migration folders shared across projects containing mysql-, postgres-, or sqlite-specific migration files being loaded by a binary built for a different dialect; adding a new dialect's migrations before the driver is registered; typos in the dialect portion of the filename.","solutions":["Verify the migration filename matches MigrationFileRegexp and uses a supported dialect (e.g. .postgres., .sqlite., .mysql.)","Only ship migration files relevant to the databases your binary supports, or gate them per deployment","Register/enable the driver so pop.DialectSupported(dbType) returns true if the dialect should be valid","Confirm dbal driver naming matches the dialect string used in the migration filename"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"m := MigrationFileRegexp.FindStringSubmatch(filename)\nif m == nil {\n\t// not a migration file at all\n}\nif dialect := extractDialect(filename); dialect != \"\" && !pop.DialectSupported(dialect) {\n\t// dialect unsupported: skip like migration_box does\n}","typeGuard":"func isUnsupportedDialectErr(err error) bool {\n\treturn errors.Is(err, errUnsupportedMigrationDialect)\n}","tryCatchPattern":"details, err := parseMigrationFilename(info.Name())\nif err != nil {\n\tif errors.Is(err, errUnsupportedMigrationDialect) {\n\t\tlogger.Debugf(\"skipping %s: %s\", info.Name(), err)\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["Only ship migration files for dialects your binary supports","Name migration files strictly per MigrationFileRegexp with a recognized dialect","Test migration loading against your migrations directory in CI"],"tags":["go","database","migrations","dialect"],"backgroundTag":"unsupported-database-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"}