mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-25 02:44:52 +08:00
Add postgresql support (#792)
* use false for bool type Signed-off-by: ChangFeng <chang_196700@hotmail.com> * use `limit ? offset ?` instead limit ?,? for database compatibility Signed-off-by: ChangFeng <chang_196700@hotmail.com> * add postgresql support Signed-off-by: ChangFeng <chang_196700@hotmail.com> * add postgres options and descriptions Signed-off-by: ChangFeng <chang_196700@hotmail.com> --------- close #791 Signed-off-by: ChangFeng <chang_196700@hotmail.com> Co-authored-by: 玖亖伍 <gsw945@foxmail.com>
This commit is contained in:
@@ -176,11 +176,11 @@ func (m *BookResult) FindToPager(pageIndex, pageSize int) (books []*BookResult,
|
||||
FROM md_books AS book
|
||||
LEFT JOIN md_relationship AS rel ON rel.book_id = book.book_id AND rel.role_id = 0
|
||||
LEFT JOIN md_members AS m ON rel.member_id = m.member_id
|
||||
ORDER BY book.order_index DESC ,book.book_id DESC LIMIT ?,?`
|
||||
ORDER BY book.order_index DESC ,book.book_id DESC limit ? offset ?`
|
||||
|
||||
offset := (pageIndex - 1) * pageSize
|
||||
|
||||
_, err = o.Raw(sql, offset, pageSize).QueryRows(&books)
|
||||
_, err = o.Raw(sql, pageSize, offset).QueryRows(&books)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user