mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-24 10:11:32 +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:
@@ -165,9 +165,9 @@ func (m *DocumentHistory) FindToPager(docId, pageIndex, pageSize int) (docs []*D
|
||||
FROM md_document_history AS history
|
||||
LEFT JOIN md_members AS m1 ON history.member_id = m1.member_id
|
||||
LEFT JOIN md_members AS m2 ON history.modify_at = m2.member_id
|
||||
WHERE history.document_id = ? ORDER BY history.history_id DESC LIMIT ?,?;`
|
||||
WHERE history.document_id = ? ORDER BY history.history_id DESC limit ? offset ?;`
|
||||
|
||||
_, err = o.Raw(sql, docId, offset, pageSize).QueryRows(&docs)
|
||||
_, err = o.Raw(sql, docId, pageSize, offset).QueryRows(&docs)
|
||||
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user