mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 API /api/query/sql add LIMIT clause https://github.com/siyuan-note/siyuan/issues/8167
This commit is contained in:
parent
8ae3b354ab
commit
a48154ba84
3 changed files with 91 additions and 8 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
|
@ -35,7 +36,7 @@ func SQL(c *gin.Context) {
|
|||
}
|
||||
|
||||
stmt := arg["stmt"].(string)
|
||||
result, err := sql.Query(stmt)
|
||||
result, err := sql.Query(stmt, model.Conf.Search.Limit)
|
||||
if nil != err {
|
||||
ret.Code = 1
|
||||
ret.Msg = err.Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue