mirror of
https://github.com/grafana/grafana.git
synced 2025-01-18 12:33:37 -06:00
Plugins: Fix problematic query (#46777)
Fixes mysql error "sql: expected 0 arguments, got 1" introduced via #46283
This commit is contained in:
parent
912018ff64
commit
1044585b50
@ -8,21 +8,24 @@ import (
|
||||
)
|
||||
|
||||
func (ss *SQLStore) GetPluginSettings(ctx context.Context, orgID int64) ([]*models.PluginSetting, error) {
|
||||
var rslt = make([]*models.PluginSetting, 0)
|
||||
sql := `SELECT org_id, plugin_id, enabled, pinned, plugin_version
|
||||
FROM plugin_setting `
|
||||
params := make([]interface{}, 0)
|
||||
|
||||
if orgID != 0 {
|
||||
sql += "WHERE org_id=?"
|
||||
params = append(params, orgID)
|
||||
}
|
||||
|
||||
var rslt []*models.PluginSetting
|
||||
err := ss.WithDbSession(ctx, func(sess *DBSession) error {
|
||||
if orgID != 0 {
|
||||
sess.Where("org_id", orgID)
|
||||
}
|
||||
|
||||
err := sess.Find(&rslt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return sess.SQL(sql, params...).Find(&rslt)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return rslt, err
|
||||
return rslt, nil
|
||||
}
|
||||
|
||||
func (ss *SQLStore) GetPluginSettingById(ctx context.Context, query *models.GetPluginSettingByIdQuery) error {
|
||||
|
Loading…
Reference in New Issue
Block a user