Lunny Xiao
46fd8f58b3
Get struct and Find support big.Float ( #1976 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1976
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 15:46:21 +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
c433fd51cb
Nil ptr is nullable ( #1919 )
...
replace #661
Co-authored-by: Jim Salem <jim@komand.com>
Co-authored-by: Oleh Herych <diesel.draft@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1919
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-06 23:20:17 +08:00
Lunny Xiao
8f64a78cd4
Support delete with no bean ( #1926 )
...
Now you can use delete like this:
```
orm.Table("my_table").Where("id=?",1).Delete()
```
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1926
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-06 17:11:45 +08:00
Lunny Xiao
d0e5dba40e
Query interface ( #1965 )
...
refactor query interface
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1965
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-04 21:23:17 +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
65846bacc3
Improve QueryString performance ( #1962 )
...
As title.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1962
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-02 11:25:20 +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
knice88
9461461967
fix pg GetColumns missing comment ( #1949 )
...
xorm reverse生成的结构体缺少备注信息
Co-authored-by: chad <example@qq.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1949
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: knice88 <knice88@noreply.gitea.io>
Co-committed-by: knice88 <knice88@noreply.gitea.io>
2021-06-12 22:47:15 +08:00
Lunny Xiao
e1422f183c
Add test to confirm #1247 resolved ( #1951 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1951
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 20:35:22 +08:00
Lunny Xiao
00ee06fdd5
Add test for dump table with default value ( #1950 )
...
Confirm #1391 resolved.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1950
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 20:27:49 +08:00
Lunny Xiao
7fd6356a85
Add DBVersion ( #1723 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1723
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 15:06:05 +08:00
Lunny Xiao
0907b7a7fd
test for unsigned int32 ( #1923 )
...
To confirm #722 has been resolved.
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1923
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 13:27:56 +08:00
Lunny Xiao
9c0901bd35
Add sync tests to confirm #539 is gone ( #1937 )
...
Fix #539
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1937
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 12:11:30 +08:00
Lunny Xiao
2b78150f70
Fix create table with struct missing columns ( #1938 )
...
Fix #1911 , #1790
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1938
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 11:44:39 +08:00
Lunny Xiao
8e22bad304
Fix bug didn't reset statement on update ( #1939 )
...
Fix #1900
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1939
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 11:43:45 +08:00
Lunny Xiao
fa4b4c4ee3
Test for #1486 ( #1942 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1942
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-09 19:30:15 +08:00
Lunny Xiao
43977186d3
Add tests for array store ( #1922 )
...
Fix #504
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1922
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-07 17:36:22 +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
2910bffb1b
Add test for find limit ( #1904 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1904
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-06 21:31:15 +08:00
Lunny Xiao
99cd8c80fb
Add tests for big.Int usage ( #1917 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1917
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-06 20:34:45 +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
136cf1a843
Add tests for FindAndCount with custom table name ( #1918 )
...
Fix #1851
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1918
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-06 19:15:51 +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
1ade49614b
More tests ( #1890 )
...
replace #1585
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1890
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-04-11 23:41:20 +08:00
Lunny Xiao
60cc3eaaf0
Unsigned Support ( #1889 )
...
This PR add support to MySQL, for other databases unsigned type will be downgrade to the related signed type.
Replace #1810
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1889
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-04-11 16:47:04 +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
ee78664413
Fix sqlite test ( #1887 )
...
Fix bug
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1887
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-04-08 21:26:21 +08:00
Lunny Xiao
40ee326cac
More clear for Get with nil ( #1879 )
...
Resolve #1844
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1879
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-03-23 21:48:58 +08:00
Lunny Xiao
9286f29576
Fix bug on import when split SQLs ( #1878 )
...
Fix #1876
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1878
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-03-23 21:34:42 +08:00
Lunny Xiao
e660414278
Support modernc.org/sqlite ( #1850 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1850
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-03-15 23:34:33 +08:00
Lunny Xiao
d41a13b562
Fix tests
2021-01-28 11:17:33 +08:00
Lunny Xiao
7c61c09af7
Revert "Automatically convert datetime to int64 ( #1715 )"
...
This reverts commit 8284e5defa
.
2021-01-28 11:03:43 +08:00
Lunny Xiao
8284e5defa
Automatically convert datetime to int64 ( #1715 )
...
Fix #1714
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1715
Reviewed-by: Jerry <jerry@noreply.gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-01-05 11:04:22 +08:00
Lunny Xiao
26b248c569
Fix update bug ( #1823 )
...
Fix #1821
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1823
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-01-05 10:55:36 +08:00
Lunny Xiao
7c8d3f1ad9
Fix bug when modify column on mssql ( #1849 )
...
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1849
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-01-05 10:37:41 +08:00
Lunny Xiao
acb337ba1f
Fix find and count bug with cols ( #1826 )
...
Fix find and count bug with cols
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1826
Co-Authored-By: Lunny Xiao <xiaolunwen@gmail.com>
Co-Committed-By: Lunny Xiao <xiaolunwen@gmail.com>
2020-11-09 12:23:14 +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
Andrew Thornton
b422930617
Fix warnings with schema Sync2 with default varchar as NVARCHAR ( #1783 )
...
prod CI
Merge branch 'fix-1782-MSSQL-nvarchar-fixes' of gitea.com:zeripath/xorm into fix-1782-MSSQL-nvarchar-fixes
map "character" to Char for postgres
Signed-off-by: Andrew Thornton <art27@cantab.net>
Merge branch 'master' into fix-1782-MSSQL-nvarchar-fixes
Postgres (and cockroachDB by inheritance) maps Char to Varchar
Signed-off-by: Andrew Thornton <art27@cantab.net>
fix test
Add a few more column testcases in light of postgres weirdness
prod CI
prod CI
prod CI
Properly handle MAX
Signed-off-by: Andrew Thornton <art27@cantab.net>
Add tests for Test and Char columns
Signed-off-by: Andrew Thornton <art27@cantab.net>
prod CI
fix test
Signed-off-by: Andrew Thornton <art27@cantab.net>
Remove the duplicate mssql drone test and add a specific sync test
Signed-off-by: Andrew Thornton <art27@cantab.net>
add depends_on (2)
Signed-off-by: Andrew Thornton <art27@cantab.net>
add depends_on
Signed-off-by: Andrew Thornton <art27@cantab.net>
add nvarchar as a testcase
Signed-off-by: Andrew Thornton <art27@cantab.net>
Set defaultVarchar to upper case
Signed-off-by: Andrew Thornton <art27@cantab.net>
Fix length issue
Signed-off-by: Andrew Thornton <art27@cantab.net>
schemas.Text should map to db.defaultVarchar
Signed-off-by: Andrew Thornton <art27@cantab.net>
Add failing test
Signed-off-by: Andrew Thornton <art27@cantab.net>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1783
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-09-08 01:36:50 +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
318102c9ff
Add params for mssql to allow redefine varchar as nvarchar or char as nchar ( #1741 )
...
Update drone test for mssql nvarchar
Add params for mssql to allow redefine varchar as nvarchar or char as nchar
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1741
2020-07-18 08:01:27 +00:00
Thomas_An
0fae64bb3b
Support get dataSourceName on ContextHook for monitor which DB executed SQL ( #1740 )
...
Merge branch 'log_context_add_db_info'
add session to context
Revert "accept lunny's suggestion"
This reverts commit 57fd669942
.
Merge branch 'master' of https://gitea.com/Thomas_An/thomasan_xorm
accept lunny's suggestion
Merge branch 'master' into master
add test code
session add Engine func
Used to monitor which DB executed this SQL
Co-authored-by: yong.an <yong.an@shopee.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1740
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-07-13 13:29:38 +00:00
Lunny Xiao
1a39682180
Fix dump of sqlite ( #1639 )
...
Fix test
fix test
Fix sqlite dump
Fix sqlite dump
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1639
2020-07-09 01:41:12 +00:00
Lunny Xiao
4dde8f14e6
Fix find and count bug ( #1651 )
...
Fix bug
fix mssql findandcount
Fix find and count bug
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1651
2020-06-13 05:31:33 +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
Lunny Xiao
79bdda3cf1
Move all integrations tests to a standalone sub package ( #1635 )
...
Fix vet
Remove unused files
Move all integrations tests to a standalone sub package
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1635
2020-03-27 07:13:04 +00:00