Lunny Xiao
107bee4eb4
refactor conversion ( #2001 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2001
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-21 11:46:41 +08:00
Lunny Xiao
a7e010df2d
refactor insert condition generation ( #1998 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1998
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-20 13:46:24 +08:00
raizen666
5950824e37
Support build flag go-json to replace default json ( #1982 )
...
`go build -tags=gojson` to use `github.com/goccy/go-json` as default json handler
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1982
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: raizen666 <raizen666@noreply.gitea.io>
Co-committed-by: raizen666 <raizen666@noreply.gitea.io>
2021-07-19 12:49:50 +08:00
Lunny Xiao
b296c8f1d7
Exec with time arg now will obey time zone settings on engine ( #1989 )
...
Fix #1770
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1989
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-14 12:20:26 +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
394c4e1f17
Replace #1044 ( #1935 )
...
Fix #1372 , #765
TODO:
- [x] Add tests
Co-authored-by: MURAOKA Taro <koron.kaoriya@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1935
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-11 21:33:01 +08:00
Lunny Xiao
b754e78269
Support big.Float ( #1973 )
...
Now you can use big.Float for numeric type.
```go
type MyMoney struct {
Id int64
Money big.Float `xorm:"numeric(22,2)"`
}
```
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1973
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 14:00:16 +08:00
Lunny Xiao
962962bb64
Fix #929 ( #1936 )
...
sql server doesn't accept to insert a blank datetime like `0001-01-01 00:00:00`. So that we have a break change here that deleted column should not have a notnull tag.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1936
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-03 20:26:49 +08:00
Lunny Xiao
8f8195a86b
Improve get field value of bean ( #1961 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1961
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-29 14:32:29 +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
bc25b4128b
Fix #1663 ( #1952 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1952
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-14 11:23:05 +08:00
Lunny Xiao
7864cb5ae6
refactor exprParam ( #1825 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1825
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-09 09:05:50 +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
d0219c37a8
Support build flag jsoniter to replace default json ( #1916 )
...
So you can `go build -tags=jsoniter` to use `github.com/json-iterator/go` as default json handler
Fix #1744
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1916
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-06 14:20:43 +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
bd9535d781
Fix comments ( #1893 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1893
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-04-12 09:19:08 +08:00
Lunny Xiao
4bfe6853f5
Fix some comments lint and bug ( #1888 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1888
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-04-10 10:57:36 +08:00
Lunny Xiao
beac298c02
Fix json tag with other type ( #1822 )
...
Fix json tag with other type
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1822
Co-Authored-By: Lunny Xiao <xiaolunwen@gmail.com>
Co-Committed-By: Lunny Xiao <xiaolunwen@gmail.com>
2020-11-03 17:10:35 +08:00
Lunny Xiao
1b200bdcba
Fix bug of ToDB when update on a nil pointer ( #1786 )
...
Fix test
Fix bug
Fix bug
Add test for insert nil struct field
Fix test
Fix bug of ToDB when update on a nil pointer
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1786
2020-09-08 15:40:26 +00:00
appleboy
fe3bc3851e
chore: enable fmt check ( #1742 )
...
chore: enable fmt check
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1742
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-07-21 04:36:55 +00:00
Lunny Xiao
b08f962d7a
Fix bug when ID used but no reference table given ( #1709 )
...
Fix bug when ID used but no reference table given
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1709
2020-06-13 01:20:25 +00:00
Lunny Xiao
8ebcb8b557
Fix find with another struct ( #1666 )
...
Fix find with another struct
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1666
2020-04-26 11:34:05 +00:00
rosbit
7e981f5f5e
fix bug for mis-converting uint64 to int64 ( #1647 )
...
fix bug for mis-converting uint64 to int64
Co-authored-by: rosbit <me@rosbit.cn>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1647
2020-04-05 04:49:44 +00:00
Lunny Xiao
2ac051f075
Improve insert map generating SQL ( #1634 )
...
Fix writeArg
Improve insert map generating SQL
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1634
2020-03-27 03:13:25 +00:00
Lunny Xiao
656cf6e5d6
Fix find and count bug ( #1622 )
...
Fix find and count bug
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1622
2020-03-23 14:39:52 +00:00
Lunny Xiao
9500b23395
Fix pk bug ( #1602 )
...
Fix pk bug
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1602
2020-03-13 08:57:34 +00: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
36e26e35ed
解决Conversion接口ToDB() ([]byte, error)方法返回*Type值为nil时,数据类型为[]byte(nil)的… ( #1296 )
...
add test
解决Conversion接口ToDB() ([]byte, error)方法返回*Type值为nil时,数据类型为[]byte(nil)的bug,解决*Type值为nil时插入数据变为""的bug
Co-authored-by: peihexian <peihexian@qq.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1296
2020-03-10 03:02:31 +00:00
Lunny Xiao
f13883a725
check driver.Valuer response, and skip the column if nil ( #1167 )
...
update tests
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1167
2020-03-10 03:01:32 +00:00
Lunny Xiao
188da20272
Move value2interface from session to statement package ( #1587 )
...
Fix zero
Fix tests
Move value2interface from session to statement package
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1587
2020-03-09 08:03:59 +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
f238bb9d07
Improve insert ( #1583 )
...
Improve insert
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1583
2020-03-08 05:14:28 +00:00
Lunny Xiao
8b100bb7d4
Fix find alias bug ( #1581 )
...
Code improvement
Fix find alias bug
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1581
2020-03-08 02:29:25 +00:00
Lunny Xiao
257653726e
return sqls for create table ( #1580 )
...
return sqls for create table
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1580
2020-03-07 12:06:28 +00:00
Lunny Xiao
ccf65397e8
Improve dialect interface ( #1579 )
...
Fix bug
Improve dialect interface
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1579
2020-03-07 10:00:05 +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
fa219bb836
Fix map with cols ( #1575 )
...
Fix cache bug
Fix map with cols
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1575
2020-03-06 08:55:12 +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
7278e2ab71
Improve tests ( #1572 )
...
fix test
Improve tests
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1572
2020-03-04 03:30:21 +00:00
Lunny Xiao
6160c8c670
fix bug on deleted with join ( #1570 )
...
fix bug on deleted with join
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1570
2020-03-03 12:45:27 +00:00
Lunny Xiao
41388c2f56
Use a new ContextLogger interface to implement logger ( #1557 )
...
Fix bug
Add log track on prepare & tx
Some improvements
remove unused codes
refactor logger
Fix bug
log context
add ContextLogger interface
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1557
2020-02-29 08:59:59 +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
Lunny Xiao
e2f9100419
Move tag parser related codes as a standalone sub package ( #1547 )
...
Fix sliceEq
fix tests
Move tag parser related codes as a standalone sub package
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1547
2020-02-27 03:58:31 +00:00
Lunny Xiao
aa522f7d98
Improve code ( #1552 )
...
Change filters
Fix test
add more tests on drone
add more tests on drone
Improve code
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1552
2020-02-27 03:33:40 +00:00
Lunny Xiao
390effb8a4
Move zero functions to a standalone package ( #1548 )
...
Remove depreciated functions and move some functions to schemas
Move zero functions to a standalone package
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1548
2020-02-26 12:45:10 +00:00