Lunny Xiao
37fd7d3c15
some refactors for write functions ( #2342 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2342
(cherry picked from commit 0f085408af
)
2023-10-28 10:05:02 +08:00
FlyingOnion
c73fc585bb
modify limit offset implement ( #2188 )
...
Oracle and SQLServer specific: When `LIMIT OFFSET` function is needed, use `OFFSET <offset> ROWS FETCH NEXT <limit> ROWS ONLY` to replace legacy subquery.
SQLServer specific: When `ORDER BY` is not set and `OFFSET FETCH` is set, set `statement.orderStr` to `1` (`ORDER BY 1`). See [here](https://learn.microsoft.com/zh-cn/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver16 ).
MySQL specific: When limit is 0 and offset > 0, use `LIMIT 9223372036854775807` ($2^{63}-1$). See comments [here](15d171ea55/internal/statements/query.go (L314)
).
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2188
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: FlyingOnion <731677080@qq.com>
Co-committed-by: FlyingOnion <731677080@qq.com>
(cherry picked from commit 551de3767c
)
2023-10-28 09:53:09 +08:00
Lunny Xiao
9aab1f689c
Count will ignore order by as before ( #2307 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2307
2023-07-25 09:27:25 +00:00
Lunny Xiao
a13564976c
refactor write update sql ( #2304 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2304
2023-07-24 07:57:05 +00:00
Lunny Xiao
6c29ab378e
refactor write insert sql ( #2302 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2302
2023-07-22 15:24:19 +00:00
Lunny Xiao
9988dac44d
improve write order by ( #2301 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2301
2023-07-22 11:52:38 +00:00
Lunny Xiao
2df56f033a
Some refactors ( #2293 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2293
2023-07-20 14:45:31 +00:00
Lunny Xiao
f1f5e7cd1a
Some refactor ( #2292 )
...
replace #2285
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2292
2023-07-12 07:53:25 +00:00
Lunny Xiao
79a8bc804b
Fix join problem ( #2291 )
...
Fix #2284
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2291
2023-07-12 02:01:56 +00:00
Lunny Xiao
f9a6990ecb
Refactor orderby and support arguments ( #2150 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2150
2022-05-31 11:00:28 +08:00
fuge
d13b607d75
oracle分页,start 为 0 的bug ( #2098 )
...
删除前面判断即可。
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2098
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: fuge <fuge@noreply.gitea.io>
Co-committed-by: fuge <fuge@noreply.gitea.io>
2022-01-16 18:04:24 +08:00
Lunny Xiao
a2d3669edf
Add README and fix some lints ( #2079 )
...
as title.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2079
2021-12-14 09:00:35 +08:00
linbaozhong
4f8f829913
exist方法sql语句优化 ( #2075 )
...
本地没有mssql和oracle,所以没法测试,但是,mysql 使用select 1 from TABLENAME where CONDITION limit 1可能更好
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2075
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: linbaozhong <linbaozhong@noreply.gitea.io>
Co-committed-by: linbaozhong <linbaozhong@noreply.gitea.io>
2021-12-01 13:54:47 +08:00
Lunny Xiao
16cf2442f6
Some performance optimization for get ( #2043 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2043
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-09-07 16:03:08 +08:00
Lunny Xiao
47cfe0347f
Add test for limit with query ( #1787 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1787
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-21 21:13:15 +08:00
andreasgerstmayr
147328f629
fix possible null dereference in internal/statements/query.go ( #1988 )
...
Make sure that pLimitN is not `nil` before dereferencing the pointer.
Co-authored-by: Andreas Gerstmayr <agerstmayr@redhat.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1988
Co-authored-by: andreasgerstmayr <andreasgerstmayr@noreply.gitea.io>
Co-committed-by: andreasgerstmayr <andreasgerstmayr@noreply.gitea.io>
2021-07-12 23:51:50 +08:00
Lunny Xiao
5a58a272bc
fix lint ( #1953 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1953
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-15 20:28:49 +08:00
Lunny Xiao
0f69f1eda2
Fix exist ( #1921 )
...
Fix #1818
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1921
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-07 13:45:29 +08:00
Lunny Xiao
409cb7c0f1
Fix findandcount or count with groupby ( #1915 )
...
Fix #1022 , #1221 , #1726 , #1836 , #1910 .
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1915
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-06 20:21:39 +08:00
Lunny Xiao
ce2a743e88
Fix comments ( #1896 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1896
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-04-12 16:00:07 +08:00
Lunny Xiao
94fd254638
Support count with cols ( #1595 )
...
Support count with cols
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1595
2020-03-11 03:29:43 +00:00
Lunny Xiao
3617ee736f
Only replace quotes when necessary ( #1584 )
...
fix test
improve code
improve code
improve code
improve code
Fix replace quote
fix test
Only replace quotes when necessary
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1584
2020-03-09 02:17:37 +00:00
Lunny Xiao
7f22948be9
Improve dialect interface ( #1578 )
...
Improve dialect interface
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1578
2020-03-07 08:51:30 +00:00
Lunny Xiao
f51d28304a
Move some codes to statement sub package ( #1574 )
...
revert change for delete
refactor new engine
fix tests
Move some codes to statement sub package
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1574
2020-03-06 06:43:49 +00:00
Lunny Xiao
2b62dc5a51
Move statement as a sub package ( #1564 )
...
Fix test
Fix bug
Move statement as a sub package
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1564
2020-02-28 12:29:08 +00:00