mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Optimized backend queries
This commit is contained in:
@@ -68,7 +68,7 @@ func GetDashboardSnapshot(query *m.GetDashboardSnapshotQuery) error {
|
||||
func SearchDashboardSnapshots(query *m.GetDashboardSnapshotsQuery) error {
|
||||
var snapshots = make(m.DashboardSnapshots, 0)
|
||||
|
||||
sess := x.Limit(query.Limit)
|
||||
sess := x.Cols("name,key,delete_key").Limit(query.Limit)
|
||||
|
||||
if query.Name != "" {
|
||||
sess.Where("name LIKE ?", query.Name)
|
||||
@@ -77,6 +77,5 @@ func SearchDashboardSnapshots(query *m.GetDashboardSnapshotsQuery) error {
|
||||
sess.Where("org_id = ?", query.OrgId)
|
||||
err := sess.Find(&snapshots)
|
||||
query.Result = snapshots
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user