Adapts feed model for database to new table schema
This commit is contained in:
parent
a9618f950e
commit
6151e9ed80
1 changed files with 3 additions and 8 deletions
|
|
@ -2,18 +2,13 @@ package database
|
||||||
|
|
||||||
type FeedType string
|
type FeedType string
|
||||||
|
|
||||||
const (
|
|
||||||
RSS FeedType = "RSS"
|
|
||||||
)
|
|
||||||
|
|
||||||
type Feed struct {
|
type Feed struct {
|
||||||
Name string
|
Name string
|
||||||
Url string
|
Url string
|
||||||
FeedType FeedType
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f Feed) Insert() (int64, error) {
|
func (f Feed) Insert() (int64, error) {
|
||||||
result, err := db.Exec("INSERT INTO feed (name, url, type) VALUES (?,?,?)", f.Name, f.Url, f.FeedType)
|
result, err := db.Exec("INSERT INTO feed (name, url) VALUES (?,?)", f.Name, f.Url)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue