Commit Graph

1639 Commits

Author SHA1 Message Date
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 8bf97de140 Fix bug on dumptable (#1984)
Fix #1983

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1984
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-11 20:05:43 +08:00
Lunny Xiao 6f46e68425 Support Get time.Time (#1933)
Fix #1107

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1933
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-11 09:30:33 +08:00
Lunny Xiao dbd45f3f8e set test timeout 20m (#1985)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1985
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-10 23:27:55 +08:00
Lunny Xiao 27b1736c57 Add test for get map with NULL column (#1948)
Add tests for #1824

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1948
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 19:16:36 +08:00
Lunny Xiao 375857b4be Add benchmark tests (#1978)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1978
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 18:17:47 +08:00
Lunny Xiao 717e4a0d21 Add database alias table and fix wrong warning (#1947)
fix #1831

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1947
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 17:09:40 +08:00
Lunny Xiao a38b1fddb3 Add tests for github.com/shopspring/decimal support (#1977)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1977
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 17:00:58 +08:00
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 54bbead2be refactor slice2Bean 2 (#1975)
as title.

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1975
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 13:59:48 +08:00
Lunny Xiao bece9a6373 refactor slice2Bean (#1974)
as title.

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1974
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 13:03:05 +08:00
Lunny Xiao bb91a0773c Fix postgres genScanResult (#1972)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1972
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-07 11:34:33 +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 a5030dc7a4 refactor get (#1967)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1967
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-06 16:06:04 +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 4f92921e43
Add changelog for v1.1.2 2021-07-04 19:04:48 +08:00
Lunny Xiao cbc40dfe5c Add release tag (#1966)
as title

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1966
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-04 18:19:46 +08:00
Lunny Xiao 60e128eb4d
Changelog for v1.1.1 2021-07-03 22:45:28 +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 66fc59b71c Query bytes based on Query string (#1964)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1964
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-07-02 12:37:03 +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 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 053a094740 refactor splitTag function (#1960)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1960
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-28 22:41:54 +08:00
antialiasis 44f892fddc Ignore comments when deciding when to replace question marks. #1954 (#1955)
This should solve #1954 and adds some tests for it. I will note I'm not 100% clear on whether there are other edge cases that should be covered here. From what I understand the only standard SQL way to escape single quotes is to double them, which shouldn't cause any problems with this, but if some SQL flavors allow other kinds of escaping, for instance, that would probably need to be covered too for ideal results.

Co-authored-by: Hlín Önnudóttir <hlin@nanitor.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1955
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: antialiasis <antialiasis@noreply.gitea.io>
Co-committed-by: antialiasis <antialiasis@noreply.gitea.io>
2021-06-26 19:19:13 +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
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 5b624ed051 Fix drone (#1946)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1946
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-12 10:47:31 +08:00
Lunny Xiao 083ab38ea0 disable unnecessary clone (#1945)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1945
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-10 21:09:01 +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 a6d2bfb4ba Compitable with cockroach (#1930)
Fix #1292

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1930
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-09 14:07:34 +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 eda6fefba3 Remove mymysql from ci (#1928)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1928
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-06-08 21:41:13 +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
janse_zyd b1449d0fb7 Replace goracle with godror (#1914)
Co-authored-by: janse_zyd <59941594@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1914
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: janse_zyd <janse_zyd@noreply.gitea.io>
Co-committed-by: janse_zyd <janse_zyd@noreply.gitea.io>
2021-06-06 21:34:02 +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
Ikko Ashimine 8843a88503 Fix typo in column.go (#1908)
Avaiable -> Available

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/1908
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Ikko Ashimine <eltociear@noreply.gitea.io>
Co-committed-by: Ikko Ashimine <eltociear@noreply.gitea.io>
2021-06-06 20:41:42 +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