limit分页不支持sqlite3数据库 #1902
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1902
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
XEngine.Limit(pageSize, pageSize*(pageIndex-1)).Find(m)分页,对sqlite3不起作用,跟踪下来发现产生的sql语句没有limit代码。用mysql没问题,改成sqllite就不行了,分页失效。
xorm有limit语法,又说支持sqllite,但分页没有相应的兼容代码。
sqllite可以用 limit 15 offset 20 表示: 从表跳过20条记录选出15条记录;xorm对于sqllite的limit那个语法是空白的应该可以增加上这块,以让分页也兼容sqlite。
Which version are you using?
xorm.io/core v0.7.3
xorm.io/xorm v1.0.5
以上来自go.mod,刚刚更新到1.07,问题依旧存在。
I cannot reproduce this. Could you paste your test codes. And you should not use
xorm.io/core
butxorm.io/xorm/core
with v1.x.x// 分页查询
是limit针对sqllite3的db不支持
According sqlite document, both SQL syntax are acceptable. https://www.sqlite.org/lang_select.html#limitoffset
不是他们不支持是xorm没有转换,你可以shousql跟踪啊。非常容易复现。
You can find the tests here #1904 , I cannot reproduce your problem.
就是这段代码,出来的就是没分页的。请问哪里错了吗?
XEngine.ShowSQL(true),看到的执行的sql代码根本没有limit。
生成的语句是:
You cannot mix
SQL
andLimit
. That's not supported and will not.