* Added a sqlXPassThrough layer

This layer embeds the original sqlx object and wraps some
key methods to avoid some boilerplate.

- Add timeout to all methods from the timeout in settings.
- Added trace functionality.
- Added auto-rebind capabilities so that each store method
doesn't need to call rebind every time.
- Added auto-lowering of query string to support NamedExec
for both MySQL and Postgres

All methods are not wrapped as all are likely not to be called
from our code. As and when they are called, support will be added.

```release-note
NONE
```

* fix lint issues

```release-note
NONE
```

* address review comments

```release-note
NONE
```

* incorporate suggestions

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2021-08-30 10:20:28 +05:30
коммит произвёл GitHub
родитель e9935e44bd
Коммит 1f3e2d0c4f
4 изменённых файлов: 389 добавлений и 11 удалений

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

@@ -29,7 +29,9 @@ func (p *MyPlugin) OnConfigurationChange() error {
}
func (p *MyPlugin) MessageWillBePosted(_ *plugin.Context, _ *model.Post) (*model.Post, string) {
store := sqlstore.New(p.API.GetUnsanitizedConfig().SqlSettings, nil)
settings := p.API.GetUnsanitizedConfig().SqlSettings
settings.Trace = model.NewBool(false)
store := sqlstore.New(settings, nil)
store.GetMaster().Db.Close()
for _, isMaster := range []bool{true, false} {