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

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