migrate from gorp to sqlx for Preference store (#18742)

Automatic Merge
Этот коммит содержится в:
Syerikjan Kh
2021-10-26 22:55:27 +08:00
коммит произвёл GitHub
родитель 841155db3e
Коммит 1091710592
3 изменённых файлов: 63 добавлений и 20 удалений

Просмотреть файл

@@ -37,7 +37,9 @@ func (p *MyPlugin) MessageWillBePosted(_ *plugin.Context, _ *model.Post) (*model
for _, isMaster := range []bool{true, false} {
// We replace the master DB with master and replica both just to make
// gorp APIs work.
store.GetMaster().Db = sql.OpenDB(driver.NewConnector(p.Driver, isMaster))
handle := sql.OpenDB(driver.NewConnector(p.Driver, isMaster))
store.GetMaster().Db = handle
store.SetMasterX(handle)
// Testing with a handful of stores
storetest.TestPostStore(p.t, store, store)