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:
Feng Chang
2023-04-14 11:09:53 +08:00
committed by GitHub
parent bc4cfdbbe6
commit 8b57c6aaf0
9 changed files with 61 additions and 30 deletions

View File

@@ -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