Signed-off-by: dusk y.bera003.06@protonmail.com
+6
-3
appview/db/follow.go
+6
-3
appview/db/follow.go
···
84
84
}
85
85
limitClause := ""
86
86
if limit > 0 {
87
-
limitClause = fmt.Sprintf(" limit %d", limit)
87
+
limitClause = " limit ?"
88
+
args = append(args, limit)
88
89
}
89
90
90
-
rows, err := e.Query(`
91
-
select user_did, subject_did, followed_at, rkey
91
+
query := fmt.Sprintf(
92
+
`select user_did, subject_did, followed_at, rkey
92
93
from follows
93
94
%s
94
95
order by followed_at desc
95
96
%s
96
97
`, whereClause, limitClause)
98
+
99
+
rows, err := e.Query(query, args...)
97
100
if err != nil {
98
101
return nil, err
99
102
}
appview/db/timeline.go
appview/db/timeline.go
This file has not been changed.
History
3 rounds
3 comments
expand 1 comment
pull request successfully merged
expand 1 comment
made a GetFollows, and made the GetFollowers and GetFollowing use that (and also removed GetAllFollows since its not necessary with GetFollows)
expand 1 comment
this is pretty cool! couple of points:
- the
GetFollow*methods are a bit repetitive (in part due to thedatabase/sqlAPIs), can we dedup them like we do in the rest of the codebase? the approach we use here is to writeGetItem(e Execer, filters ...filter) ([]Item, error)and then use filters to create more specific getters. you can look atdb/spindlesfor an example - we could do something similar for
GetFollowStatusi think
oops T.T actually fixed it