{"record":{"id":"d623e6b20e19ee84","repo":"golang-migrate/migrate","slug":"no-config-d623e6","errorCode":null,"errorMessage":"no config","messagePattern":"no config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"database/firebird/firebird.go","lineNumber":28,"sourceCode":"\t\"io\"\n\tnurl \"net/url\"\n\t\"sync/atomic\"\n\n\t\"github.com/golang-migrate/migrate/v4\"\n\t\"github.com/golang-migrate/migrate/v4/database\"\n\t_ \"github.com/nakagami/firebirdsql\"\n)\n\nfunc init() {\n\tdb := Firebird{}\n\tdatabase.Register(\"firebird\", &db)\n\tdatabase.Register(\"firebirdsql\", &db)\n}\n\nvar DefaultMigrationsTable = \"schema_migrations\"\n\nvar (\n\tErrNilConfig = fmt.Errorf(\"no config\")\n)\n\ntype Config struct {\n\tDatabaseName    string\n\tMigrationsTable string\n}\n\ntype Firebird struct {\n\t// Locking and unlocking need to use the same connection\n\tconn     *sql.Conn\n\tdb       *sql.DB\n\tisLocked atomic.Bool\n\n\t// Open and WithInstance need to guarantee that config is never nil\n\tconfig *Config\n}\n\nfunc WithInstance(instance *sql.DB, config *Config) (database.Driver, error) {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/golang-migrate/migrate/blob/01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a/database/firebird/firebird.go#L10-L46","documentation":"ErrNilConfig in database/firebird is the package-level sentinel returned when a Firebird driver constructor (WithInstance, WithConnection) or extractCustomQueryParams receives a nil *Config. It means the caller invoked the driver without supplying migration configuration (e.g. DatabaseName/MigrationsTable), so the driver cannot proceed. It is a static guard error, never network-related.","triggerScenarios":"Calling firebird.WithInstance(conn, nil) or firebird.WithConnection(db, nil); calling WithConfig/WithInstance via the migrate framework with an empty config pointer; extractCustomQueryParams invoked with nil config.","commonSituations":"Constructing a migrate instance with a typed nil *firebird.Config, forgetting to call firebird.WithConfig/WithInstance before use, or passing config through a helper that silently drops nil pointers.","solutions":["Pass a non-nil *firebird.Config to WithInstance/WithConnection","Build config via firebird.WithConfig(dsn) instead of hand-constructing a zero pointer","Check for nil config in your own wrapper before calling the driver"],"exampleFix":"// before\nvar cfg *firebird.Config\nd, err := firebird.WithInstance(conn, cfg)\n// after\ncfg, err := firebird.WithConfig(\"user:pass@host/db\")\nif err != nil { return err }\nd, err := firebird.WithInstance(conn, cfg)","handlingStrategy":"validation","validationCode":"if cfg == nil {\n    return fmt.Errorf(\"firebird migration requires a config: build one via firebird.WithConfig(dsn)\")\n}","typeGuard":"func hasFirebirdConfig(cfg *firebird.Config) bool { return cfg != nil }","tryCatchPattern":"if err != nil {\n    if errors.Is(err, firebird.ErrNilConfig) {\n        // fix bootstrap config wiring\n    }\n    return err\n}","preventionTips":["Always create config through firebird.WithConfig rather than zero-valued pointers","Nil-check config in the single place drivers are constructed","Cover driver construction with a unit test asserting non-nil config"],"tags":["go","golang-migrate","firebird","config","nil-pointer"],"backgroundTag":"nil-config-passed-to-driver","analyzedSha":"01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a","analyzedAt":"2026-09-02T19:38:29.671Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}