Update to use pg/v10

This commit is contained in:
Las Zenow 2020-11-30 19:03:31 +00:00
parent 94c75b1d2a
commit 1536d97d8d
13 changed files with 449 additions and 98 deletions

View file

@ -18,10 +18,11 @@ func (db *pgDB) AddNews(text string) error {
}
func (db *pgDB) AddRawNews(text string, date time.Time) error {
return db.sql.Insert(&New{
_, err := db.sql.Model(&New{
Text: text,
Date: date,
})
}).Insert()
return err
}
// GetNews returns all the news for the last 'days' limiting with a maximum of 'num' results