{"record":{"id":"22fd87e554b970fa","repo":"golang-migrate/migrate","slug":"no-config-22fd87","errorCode":null,"errorMessage":"no config","messagePattern":"no config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"database/rqlite/rqlite.go","lineNumber":30,"sourceCode":"\t\"github.com/golang-migrate/migrate/v4\"\n\t\"github.com/golang-migrate/migrate/v4/database\"\n\t\"github.com/rqlite/gorqlite\"\n)\n\nfunc init() {\n\tdatabase.Register(\"rqlite\", &Rqlite{})\n}\n\nconst (\n\t// DefaultMigrationsTable defines the default rqlite migrations table\n\tDefaultMigrationsTable = \"schema_migrations\"\n\n\t// DefaultConnectInsecure defines the default setting for connect insecure\n\tDefaultConnectInsecure = false\n)\n\n// ErrNilConfig is returned if no configuration was passed to WithInstance\nvar ErrNilConfig = fmt.Errorf(\"no config\")\n\n// ErrBadConfig is returned if configuration was invalid\nvar ErrBadConfig = fmt.Errorf(\"bad parameter\")\n\n// Config defines the driver configuration\ntype Config struct {\n\t// ConnectInsecure sets whether the connection uses TLS. Ineffectual when using WithInstance\n\tConnectInsecure bool\n\t// MigrationsTable configures the migrations table name\n\tMigrationsTable string\n}\n\ntype Rqlite struct {\n\tdb       *gorqlite.Connection\n\tisLocked atomic.Bool\n\n\tconfig *Config\n}","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/golang-migrate/migrate/blob/01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a/database/rqlite/rqlite.go#L12-L48","documentation":"ErrNilConfig (message \"no config\") is returned by the rqlite driver's WithInstance and WithConnection when the *Config argument is nil. The driver needs a Config to know settings like MigrationsTable and ConnectInsecure, and it dereferences the pointer immediately, so passing nil is rejected up front. It is a programmer error, not a runtime/network problem.","triggerScenarios":"Calling rqlite.WithInstance(conn, nil) or WithConnection(conn, nil) instead of passing a &rqlite.Config{}.","commonSituations":"Building the config conditionally and leaving it nil when all env vars are absent; copying driver boilerplate from another package and forgetting to init Config; passing a typed nil (*rqlite.Config)(nil) into a generic helper.","solutions":["Construct and pass a non-nil config: &rqlite.Config{} (empty struct is accepted; MigrationsTable defaults to schema_migrations)","Check your factory helper so it never returns a nil *rqlite.Config","Note this check is per-driver: database/rqlite.ErrNilConfig is a distinct value from cassandra/pgx ErrNilConfig — compare with errors.Is against the right package"],"exampleFix":"// before\nvar cfg *rqlite.Config\ndriver, err := rqlite.WithInstance(conn, cfg) // nil -> ErrNilConfig\n// after\ncfg := &rqlite.Config{MigrationsTable: \"schema_migrations\"}\ndriver, err := rqlite.WithInstance(conn, cfg)","handlingStrategy":"validation","validationCode":"if cfg == nil {\n    return nil, fmt.Errorf(\"rqlite: config must be provided\")\n}\ndriver, err := rqlite.WithInstance(conn, cfg)","typeGuard":"func hasRqliteConfig(cfg *rqlite.Config) bool { return cfg != nil }","tryCatchPattern":null,"preventionTips":["Never declare config as a bare *rqlite.Config var; initialize inline with &rqlite.Config{...}","Default to an empty struct — WithInstance fills MigrationsTable with the default","Keep config construction in one factory function that cannot return nil without an error"],"tags":["go","golang-migrate","rqlite","config","nil-pointer"],"backgroundTag":"missing-config-object","analyzedSha":"01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a","analyzedAt":"2026-09-02T19:38:29.671Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}