From 75db6ae83df1ef672f63340f05036e1c80f094b7 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sun, 22 Apr 2018 20:20:38 -0700 Subject: fix some performance issues because mysql is weird? --- models/item/item.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/item/item.go b/models/item/item.go index b3dc5eb..4d3f455 100644 --- a/models/item/item.go +++ b/models/item/item.go @@ -117,7 +117,7 @@ func Filter(max_id int64, feed_id int64, category string, unread_only bool, star var args []interface{} - query := `SELECT item.id, item.title, item.url, item.description, + query := `SELECT item.id, item.feed_id, item.title, item.url, item.description, item.read_state, item.starred, item.publish_date, item.full_content, item.header_image, feed.url, feed.title, feed.category @@ -163,7 +163,8 @@ func Filter(max_id int64, feed_id int64, category string, unread_only bool, star items := make([]*Item, 0) for rows.Next() { i := new(Item) - err := rows.Scan(&i.Id, &i.Title, &i.Url, &i.Description, &i.ReadState, &i.Starred, &i.PublishDate, &i.FullContent, &i.HeaderImage, &i.FeedUrl, &i.FeedTitle, &i.FeedCategory) + var feed_id int64 + err := rows.Scan(&i.Id, &feed_id, &i.Title, &i.Url, &i.Description, &i.ReadState, &i.Starred, &i.PublishDate, &i.FullContent, &i.HeaderImage, &i.FeedUrl, &i.FeedTitle, &i.FeedCategory) if err != nil { log.Println(err) return nil, err -- cgit v1.2.3