chore (replstore): fix registration with multiple sql drivers, again (#90990)

* replstore: fix registration with multiple sql drivers, again
* only compile regex once
This commit is contained in:
Kristin Laemmert
2024-07-25 15:13:36 -04:00
committed by GitHub
parent 9852513c65
commit daedb358dd
3 changed files with 25 additions and 15 deletions
+8 -7
View File
@@ -107,13 +107,14 @@ type LockCfg struct {
type dialectFunc func() Dialect
var supportedDialects = map[string]dialectFunc{
MySQL: NewMysqlDialect,
SQLite: NewSQLite3Dialect,
Postgres: NewPostgresDialect,
MySQL + "WithHooks": NewMysqlDialect,
MySQL + "ReplicaWithHooks": NewMysqlDialect,
SQLite + "WithHooks": NewSQLite3Dialect,
Postgres + "WithHooks": NewPostgresDialect,
MySQL: NewMysqlDialect,
SQLite: NewSQLite3Dialect,
Postgres: NewPostgresDialect,
MySQL + "WithHooks": NewMysqlDialect,
MySQL + "ReplicaWithHooks": NewMysqlDialect,
SQLite + "WithHooks": NewSQLite3Dialect,
Postgres + "WithHooks": NewPostgresDialect,
Postgres + "ReplicaWithHooks": NewPostgresDialect,
}
func NewDialect(driverName string) Dialect {