additional work on reading posts - still not quite there yet but getting closer

This commit is contained in:
2025-12-19 23:23:58 -07:00
parent 57d664dcb1
commit 80bd0e03fd
11 changed files with 325 additions and 151 deletions
+9
View File
@@ -49,3 +49,12 @@ func AmGetPost(postId int64) (*PostHeader, error) {
}
return &(dbdata[0]), nil
}
func AmGetPostRange(topic *Topic, first, last int32) ([]PostHeader, error) {
var rc []PostHeader
err := amdb.Select(&rc, "SELECT * FROM posts WHERE topicid = ? AND num >= ? AND num <= ? ORDER BY num", topic.TopicId, first, last)
if err != nil {
return nil, err
}
return rc, nil
}