empact/db/repo.go

23 lines
320 B
Go
Raw Normal View History

2015-03-05 02:09:08 +07:00
package db
import (
"github.com/fatih/structs"
)
type (
Repo struct {
Owner string
Name string
}
)
const (
2015-03-05 03:51:17 +07:00
saveRepoQuery = "replace into repos (owner, name, updated_at) values (?, ?, now())"
2015-03-05 02:09:08 +07:00
)
2015-03-05 03:51:17 +07:00
func (r *Repo) Save() {
if _, err := stmt(saveRepoQuery).Exec(structs.Values(r)); err != nil {
2015-03-05 02:09:08 +07:00
panic(err)
}
}