mysql: minor update

This commit is contained in:
Torkel Ödegaard
2017-03-30 20:23:40 +02:00
parent 998f04e1e8
commit bd4f073425
5 changed files with 24 additions and 4 deletions
+12 -3
View File
@@ -1,6 +1,8 @@
package sqlstore
import (
"time"
"github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models"
)
@@ -12,10 +14,17 @@ func init() {
func InsertSqlTestData(cmd *m.InsertSqlTestDataCommand) error {
return inTransaction2(func(sess *session) error {
// create user
user := &m.SqlTestData{}
row := &m.SqlTestData{
Metric1: "server1",
Metric2: "frontend",
ValueBigInt: 123123,
ValueDouble: 3.14159265359,
ValueFloat: 3.14159265359,
TimeEpoch: time.Now().Unix(),
TimeDateTime: time.Now(),
}
if _, err := sess.Insert(user); err != nil {
if _, err := sess.Table("test_data").Insert(row); err != nil {
return err
}