{"record":{"id":"74056e9b21a2b54a","repo":"golang-migrate/migrate","slug":"invalid-value-for-x-migrations-table-w","errorCode":null,"errorMessage":"invalid value for x-migrations-table: %w","messagePattern":"invalid value for x-migrations-table: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"database/rqlite/rqlite.go","lineNumber":313,"sourceCode":"\t} else {\n\t\tparsedUrl.Scheme = \"https\"\n\t}\n\n\tfilteredUrl := migrate.FilterCustomQuery(parsedUrl)\n\n\treturn filteredUrl, config, nil\n}\n\nfunc parseConfigFromQuery(queryVals nurl.Values) (*Config, error) {\n\tc := Config{\n\t\tConnectInsecure: DefaultConnectInsecure,\n\t\tMigrationsTable: DefaultMigrationsTable,\n\t}\n\n\tmigrationsTable := queryVals.Get(\"x-migrations-table\")\n\tif migrationsTable != \"\" {\n\t\tif strings.HasPrefix(migrationsTable, \"sqlite_\") {\n\t\t\treturn nil, fmt.Errorf(\"invalid value for x-migrations-table: %w\", ErrBadConfig)\n\t\t}\n\t\tc.MigrationsTable = migrationsTable\n\t}\n\n\tconnectInsecureStr := queryVals.Get(\"x-connect-insecure\")\n\tif connectInsecureStr != \"\" {\n\t\tconnectInsecure, err := strconv.ParseBool(connectInsecureStr)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid value for x-connect-insecure: %w\", ErrBadConfig)\n\t\t}\n\t\tc.ConnectInsecure = connectInsecure\n\t}\n\n\treturn &c, nil\n}\n","sourceCodeStart":295,"sourceCodeEnd":329,"githubUrl":"https://github.com/golang-migrate/migrate/blob/01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a/database/rqlite/rqlite.go#L295-L329","documentation":"\"invalid value for x-migrations-table: %w\" is raised in rqlite's parseConfigFromQuery (rqlite.go:313) when the x-migrations-table query parameter starts with the reserved prefix \"sqlite_\", wrapping ErrBadConfig. The driver reserves sqlite_-prefixed table names for SQLite compatibility and refuses to let the rqlite migrations table use them.","triggerScenarios":"URLs like rqlite://host/db?x-migrations-table=sqlite_migrations or any custom table name beginning with sqlite_.","commonSituations":"Copying a SQLite driver URL (which allows sqlite_-prefixed tables) into the rqlite driver; a shared DSN template across SQLite and rqlite environments.","solutions":["Rename the migrations table to something without the sqlite_ prefix, e.g. x-migrations-table=schema_migrations_custom","Drop the x-migrations-table param entirely to use the default schema_migrations","Extract and validate the query param before building the URL"],"exampleFix":"// before\nurl := \"rqlite://localhost:4001/db?x-migrations-table=sqlite_migrations\"\n// after\nurl := \"rqlite://localhost:4001/db?x-migrations-table=migrations\"","handlingStrategy":"validation","validationCode":"q := u.Query()\ntable := q.Get(\"x-migrations-table\")\nif table != \"\" && strings.HasPrefix(table, \"sqlite_\") {\n    return fmt.Errorf(\"x-migrations-table %q is reserved (sqlite_ prefix)\", table)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve sqlite_-prefixed names for the SQLite driver only","Use a naming convention like migrations or schema_migrations_<env> for custom table names","Lint your DSN templates for reserved prefixes"],"tags":["go","golang-migrate","rqlite","config","query-params"],"backgroundTag":"invalid-dsn-parameter","analyzedSha":"01a9643f1475e75bb6d6224ddeaf9d8e2434ca8a","analyzedAt":"2026-09-02T19:38:29.671Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}