annotation.go 374 B

123456789101112131415161718192021
  1. package sqlstore
  2. import (
  3. "github.com/go-xorm/xorm"
  4. "github.com/grafana/grafana/pkg/services/annotations"
  5. )
  6. type SqlAnnotationRepo struct {
  7. }
  8. func (r *SqlAnnotationRepo) Save(item *annotations.Item) error {
  9. return inTransaction(func(sess *xorm.Session) error {
  10. if _, err := sess.Table("annotation").Insert(item); err != nil {
  11. return err
  12. }
  13. return nil
  14. })
  15. }