* Kill gorp

Gorp is dead. Long live Gorp.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-03-15 19:49:19 +05:30
коммит произвёл GitHub
родитель c3ec0a145b
Коммит 4da98cb51a
47 изменённых файлов: 102 добавлений и 5179 удалений

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

@@ -32,13 +32,10 @@ func (p *MyPlugin) MessageWillBePosted(_ *plugin.Context, _ *model.Post) (*model
settings := p.API.GetUnsanitizedConfig().SqlSettings
settings.Trace = model.NewBool(false)
store := sqlstore.New(settings, nil)
store.GetMaster().Db.Close()
store.GetMasterX().Close()
for _, isMaster := range []bool{true, false} {
// We replace the master DB with master and replica both just to make
// gorp APIs work.
handle := sql.OpenDB(driver.NewConnector(p.Driver, isMaster))
store.GetMaster().Db = handle
store.SetMasterX(handle)
wrapper := sqlstore.NewStoreTestWrapper(store)
@@ -49,7 +46,7 @@ func (p *MyPlugin) MessageWillBePosted(_ *plugin.Context, _ *model.Post) (*model
storetest.TestChannelStore(p.t, store, wrapper)
storetest.TestBotStore(p.t, store, wrapper)
store.GetMaster().Db.Close()
store.GetMasterX().Close()
}
// Use the API to instantiate the driver