DB RPC driver: add master/replica support (#17792)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2021-06-17 21:10:22 +05:30
коммит произвёл GitHub
родитель 030543fed9
Коммит 79d4e9e9a9
6 изменённых файлов: 37 добавлений и 19 удалений

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

@@ -109,9 +109,13 @@ type ResultContainer struct {
RowsAffectedError error
}
// Driver is a sql driver interface that is used by plugins to perform
// raw SQL queries without opening DB connections by themselves. This interface
// is not subject to backward compatibility guarantees and is only meant to be
// used by plugins built by the Mattermost team.
type Driver interface {
// Connection
Conn() (string, error)
Conn(isMaster bool) (string, error)
ConnPing(connID string) error
ConnClose(connID string) error
ConnQuery(connID, q string, args []driver.NamedValue) (string, error) // rows