empact/db/repo.go

13 lines
255 B
Go
Raw Normal View History

2015-03-05 02:09:08 +07:00
package db
2015-03-06 17:00:04 +07:00
type Repo struct {
Owner string `json:"owner"`
Name string `json:"name"`
}
2015-03-05 02:09:08 +07:00
2015-03-06 17:00:04 +07:00
const 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() {
2015-03-06 17:00:04 +07:00
conn.MustExec(saveRepoQuery, r.Owner, r.Name)
2015-03-05 02:09:08 +07:00
}