{"record":{"id":"a83a1bbe33f45e8a","repo":"go-gorm/gorm","slug":"not-support","errorCode":null,"errorMessage":"not support","messagePattern":"not support","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"migrator/migrator.go","lineNumber":1032,"sourceCode":"\t}\n\n\tfor _, name := range orderedModelNames {\n\t\tresults = append(results, valuesMap[name].Statement.Dest)\n\t}\n\treturn\n}\n\n// CurrentTable returns current statement's table expression\nfunc (m Migrator) CurrentTable(stmt *gorm.Statement) interface{} {\n\tif stmt.TableExpr != nil {\n\t\treturn *stmt.TableExpr\n\t}\n\treturn clause.Table{Name: stmt.Table}\n}\n\n// GetIndexes return Indexes []gorm.Index and execErr error\nfunc (m Migrator) GetIndexes(dst interface{}) ([]gorm.Index, error) {\n\treturn nil, errors.New(\"not support\")\n}\n\n// GetTypeAliases return database type aliases\nfunc (m Migrator) GetTypeAliases(databaseTypeName string) []string {\n\treturn nil\n}\n\n// TableType return tableType gorm.TableType and execErr error\nfunc (m Migrator) TableType(dst interface{}) (gorm.TableType, error) {\n\treturn nil, errors.New(\"not support\")\n}\n","sourceCodeStart":1014,"sourceCodeEnd":1044,"githubUrl":"https://github.com/go-gorm/gorm/blob/1d6ce99528060be18a42be09aca8d39efcb47f28/migrator/migrator.go#L1014-L1044","documentation":"GetIndexes on the base gorm.Migrator is a stub that returns errors.New(\"not support\"). Each dialect driver (MySQL, Postgres, SQLite, SQLServer) is expected to override it; getting this error means the migrator in use did not provide an implementation, so index introspection is unavailable.","triggerScenarios":"Calling db.Migrator().GetIndexes(&User{}) on a driver whose Migrator type does not override GetIndexes (niche/unmaintained drivers, or an old driver version predating the API), or calling it directly on the embedded base Migrator.","commonSituations":"Using a community driver (clickhouse, odps, luaxia/sqlite forks) that never implemented GetIndexes; upgrading GORM core to a version that added the API faster than the driver did; writing schema-diff tooling that assumes every dialect supports index introspection.","solutions":["Upgrade the dialect driver to a version that implements GetIndexes.","Query the dialect's catalog directly (information_schema.statistics / pg_indexes / sqlite_master) with db.Raw.","If you maintain the driver, implement GetIndexes on your Migrator.","Feature-detect at startup so the tool degrades gracefully instead of failing per call."],"exampleFix":"// before\nidxs, err := db.Migrator().GetIndexes(&User{}) // err = \"not support\"\n\n// after (dialect catalog query)\nvar rows []struct{ IndexName string }\ndb.Raw(\"SELECT indexname AS index_name FROM pg_indexes WHERE tablename = ?\", \"users\").Scan(&rows)","handlingStrategy":"fallback","validationCode":"func supportsGetIndexes(m gorm.Migrator) bool {\n    _, err := m.GetIndexes(&probeModel{})\n    return err == nil || !strings.Contains(err.Error(), \"not support\")\n}","typeGuard":null,"tryCatchPattern":"idxs, err := db.Migrator().GetIndexes(&User{})\nif err != nil && strings.Contains(err.Error(), \"not support\") {\n    idxs, err = indexesFromCatalog(db, \"users\") // fallback raw SQL\n}\nif err != nil { return err }","preventionTips":["Feature-detect migrator capabilities once at startup and store the result.","Pin driver versions known to implement the introspection APIs you use."],"tags":["gorm","migration","index","driver","not-implemented"],"backgroundTag":null,"analyzedSha":"1d6ce99528060be18a42be09aca8d39efcb47f28","analyzedAt":"2026-08-15T13:01:23.433Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}