PostgreSQL: Read postgresDSUsePGX from config (#112170)
* PostgreSQL: Read `postgresDSUsePGX` from config * Update plugins_test
This commit is contained in:
@@ -128,7 +128,7 @@ func newPostgresPGX(ctx context.Context, userFacingDefaultError string, rowLimit
|
||||
return p, handler, nil
|
||||
}
|
||||
|
||||
func NewInstanceSettings(logger log.Logger, usePGX bool, dataPath string) datasource.InstanceFactoryFunc {
|
||||
func NewInstanceSettings(logger log.Logger, dataPath string) datasource.InstanceFactoryFunc {
|
||||
return func(ctx context.Context, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
|
||||
cfg := backend.GrafanaConfigFromContext(ctx)
|
||||
sqlCfg, err := cfg.SQL()
|
||||
@@ -171,6 +171,8 @@ func NewInstanceSettings(logger log.Logger, usePGX bool, dataPath string) dataso
|
||||
return nil, err
|
||||
}
|
||||
|
||||
usePGX := cfg.FeatureToggles().IsEnabled("postgresDSUsePGX")
|
||||
|
||||
if usePGX {
|
||||
pgxlogger := logger.FromContext(ctx).With("driver", "pgx")
|
||||
pgxTlsManager := newPgxTlsManager(pgxlogger)
|
||||
|
||||
Reference in New Issue
Block a user