Kill gorp (#19786)
* Kill gorp Gorp is dead. Long live Gorp. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c3ec0a145b
Коммит
4da98cb51a
@@ -5,8 +5,6 @@ package sqlstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/mattermost/gorp"
|
||||
)
|
||||
|
||||
// storeContextKey is the base type for all context keys for the store.
|
||||
@@ -35,14 +33,6 @@ func hasMaster(ctx context.Context) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// DBFromContext is a helper utility that returns the DB handle from a given context.
|
||||
func (ss *SqlStore) DBFromContext(ctx context.Context) *gorp.DbMap {
|
||||
if hasMaster(ctx) {
|
||||
return ss.GetMaster()
|
||||
}
|
||||
return ss.GetReplica()
|
||||
}
|
||||
|
||||
// DBXFromContext is a helper utility that returns the sqlx DB handle from a given context.
|
||||
func (ss *SqlStore) DBXFromContext(ctx context.Context) *sqlxDBWrapper {
|
||||
if hasMaster(ctx) {
|
||||
|
||||
Ссылка в новой задаче
Block a user