You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/model/post.go
+26
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ const stmtGetPostBySlug = `SELECT * FROM posts WHERE slug = ?`
19
19
conststmtGetPostsByTag=`SELECT * FROM posts WHERE %s id IN ( SELECT post_id FROM posts_tags WHERE tag_id = ? ) ORDER BY published_at DESC LIMIT ? OFFSET ?`
20
20
conststmtGetAllPostsByTag=`SELECT * FROM posts WHERE id IN ( SELECT post_id FROM posts_tags WHERE tag_id = ?) ORDER BY published_at DESC `
21
21
conststmtGetPostsCountByTag="SELECT count(*) FROM posts, posts_tags WHERE posts_tags.post_id = posts.id AND posts.published AND posts_tags.tag_id = ?"
22
+
conststmtGetPostsOffsetLimit=`SELECT * FROM posts WHERE published = ? LIMIT ?, ?`
22
23
conststmtInsertPostTag=`INSERT INTO posts_tags (id, post_id, tag_id) VALUES (?, ?, ?)`
23
24
conststmtDeletePostTagsByPostId=`DELETE FROM posts_tags WHERE post_id = ?`
24
25
conststmtNumberOfPosts="SELECT count(*) FROM posts WHERE %s"
0 commit comments