mysql: testdata

This commit is contained in:
Torkel Ödegaard
2017-03-30 20:01:04 +02:00
parent 34d92b0e79
commit 998f04e1e8
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package sqlstore
import (
"github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models"
)
func init() {
bus.AddHandler("sql", InsertSqlTestData)
}
func InsertSqlTestData(cmd *m.InsertSqlTestDataCommand) error {
return inTransaction2(func(sess *session) error {
// create user
user := &m.SqlTestData{}
if _, err := sess.Insert(user); err != nil {
return err
}
return nil
})
}