Commit Graph

1761 Commits

Author SHA1 Message Date
Lunny Xiao 6a9b4ef926 Add test for max ( id ) (#2316)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2316
(cherry picked from commit 407375c9b4)
2023-10-28 09:53:00 +08:00
Lunny Xiao 6b554f8b74 Fix ci (#2330)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2330
(cherry picked from commit eeacd22674)
2023-10-28 09:52:51 +08:00
CyJaySong ad73876977 Merge remote-tracking branch 'cyjay/master' 2023-10-28 09:51:12 +08:00
CyJaySong 24540c9e23 Fix the issue of incorrect insertion of data in non UTC time zone zero for numeric types 2023-10-28 09:49:51 +08:00
CyJaySong 37eadc847c Merge pull request 'merge xorm:master' (#2) from xorm/xorm:master into master
Reviewed-on: https://gitea.com/CyJaySong/xorm/pulls/2
2023-08-18 07:10:33 +00:00
6543 db7c264062 Add Sync options to ignore constrains and indices (#2320)
needed for https://github.com/woodpecker-ci/woodpecker/pull/2117

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2320
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2023-08-09 03:28:52 +00:00
Lunny Xiao ac84217e14 Exec support conversion data (#1970)
Fix #1803

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1970
2023-08-07 10:54:57 +00:00
CyJaySong 620074d751 Merge remote-tracking branch 'cyjay/master' 2023-08-07 13:38:05 +08:00
CyJaySong 2d9e07360a Merge branch 'master'
# Conflicts:
#	tests/session_insert_test.go
2023-08-07 13:36:42 +08:00
CyJaySong 94882e39df Fix deleted tag attribute zeroTime is not DatabaseTZ (#2299)
Co-authored-by: CyJay <cyjay@MacBook-Pro.lan>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2299
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: CyJaySong <CyJaySong@gmail.com>
Co-committed-by: CyJaySong <CyJaySong@gmail.com>
2023-08-07 04:28:55 +00:00
Lunny Xiao d9f3ee63ef
improve tests 2023-08-07 11:53:36 +08:00
CyJaySong fff2adbf77 fix code 2023-07-27 18:00:03 +08:00
CyJaySong 6c8799fdea SQL Server database, default mapping of time type to DATETIME2 2023-07-27 17:22:07 +08:00
CyJaySong 3396c4cbba fix String2Time 2023-07-27 16:42:17 +08:00
CyJaySong 64ad1ac161 fix String2Time 2023-07-27 16:31:09 +08:00
CyJaySong 0c82bad52b Merge branch 'master' 2023-07-27 14:57:43 +08:00
Lunny Xiao c622cdaf89
Add ignore 2023-07-26 18:46:36 +08:00
Lunny Xiao e2af77de3b
remove unused files 2023-07-26 18:45:28 +08:00
Lunny Xiao ed1a37b1c5 Move integrations -> tests (#2314)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2314
2023-07-26 10:44:41 +00:00
CyJaySong 4b458f1c75 Merge remote-tracking branch 'cyjay/master' 2023-07-26 15:51:21 +08:00
CyJaySong 82327cba2f fix code 2023-07-26 15:51:03 +08:00
CyJaySong 9e362d7913 Merge branch 'master'
# Conflicts:
#	convert/time.go
2023-07-26 15:35:54 +08:00
Lunny Xiao 47003ff937 Delete Limit with start will return error because it's not supported by database (#1895)
Fix #1894

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1895
2023-07-26 06:58:55 +00:00
Lunny Xiao 12ec038853 Add test for get customized types (#2194)
Fix #2097

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2194
2023-07-26 03:03:01 +00:00
Lunny Xiao b75df472e4 Merge branch 'master' of gitea.com:CyJaySong/xorm into CyJaySong-master 2023-07-26 09:47:36 +08:00
takumin 1572367155 Add dialects/time_test.go (#2169)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2169
Co-authored-by: takumin <takumiiinn@gmail.com>
Co-committed-by: takumin <takumiiinn@gmail.com>
2023-07-26 00:57:40 +00:00
Lunny Xiao 59b727260d Check orderby validate (#2313)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2313
2023-07-25 14:02:38 +00:00
Lunny Xiao cb4f310151 Refactor write update (#2310)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2310
2023-07-25 10:49:55 +00: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 4109ce1e23 Fix a serious bug when using rows and reuse the session (#2309)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2309
2023-07-25 08:37:12 +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
arturwwl 24a672be3c convert - String2Time accept HH:mm:ss format (#2074)
resolves #2073

Co-authored-by: arturwwl <>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2074
Co-authored-by: arturwwl <arturwwl@noreply.gitea.com>
Co-committed-by: arturwwl <arturwwl@noreply.gitea.com>
2023-07-23 02:34:10 +00:00
Lunny Xiao 3626de1459 mod tidy (#2303)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2303
2023-07-23 01:31:59 +00:00
datbeohbbh c0d09c0def update go version in `go.mod` (#2224)
Hi! I would like to request an update to the `go.mod` file.

Co-authored-by: datbeohbbh <phongtomfapp@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2224
Co-authored-by: datbeohbbh <datbeohbbh@noreply.gitea.com>
Co-committed-by: datbeohbbh <datbeohbbh@noreply.gitea.com>
2023-07-23 01:30:49 +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 96ed5584e3 move sql geneartion for update to statement (#2300)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2300
2023-07-21 16:25:58 +00:00
CyJaySong 58ba01b299 fix code 2023-07-21 11:35:15 +08:00
CyJaySong 21b54e5d61 fix code 2023-07-21 11:12:31 +08:00
CyJaySong 269811a497 fix code 2023-07-21 10:14:13 +08:00
CyJay 48cf8bb174 Merge branch 'master'
# Conflicts:
#	convert/time.go
2023-07-21 09:07:56 +08:00
Lunny Xiao dabcb4c0ee Return error if count returned no row (#2298)
Fix #2139

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2298
2023-07-20 14:48:29 +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
CyJaySong eb076f4b94 fix String2Time 2023-07-14 18:30:43 +08:00
CyJaySong 50ef83d456 fix TestTagTime 2023-07-14 18:27:29 +08:00
CyJaySong a6b31d79d7 fix conditions build on MSSQL 2023-07-14 17:50:54 +08:00
CyJaySong 7bb3224115 SQL Server database, default mapping of time type to DATETIME2 2023-07-14 17:20:32 +08:00
CyJaySong a16551c6e7 SQL Server database, default mapping of time type to DATETIME2 2023-07-14 17:13:52 +08:00
CyJaySong 93ef9bd84a del not right test struct 2023-07-14 16:39:06 +08:00
LinkinStars 9b71cb49cc The loadTableInfo function supports passing the context. (#2297)
## `loadTableInfo` add context parameter

### Main change
```diff
+++ func (engine *Engine) loadTableInfo(ctx context.Context, table *schemas.Table) error
--- func (engine *Engine) loadTableInfo(table *schemas.Table) error
```

### Situation
After #2200, I built custom dialect to control the SQL. I find that everything else is fine, except when the `SYNC` method executes with an exception.
The reason is that the `loadTableInfo` method calls the `GetIndexes` and `GetColumns` methods with the dialect during execution. **The context passed to these two methods are all `engine.defaultContext` not the current session's context.** So, I think the `loadTableInfo` method should add the context parameter to ensure that the correct context is used during execution.

### Review Note
1. dialect's `GetColumns` and `GetIndexes` methods are **only** used here, if the context here is incorrect, then the context parameter is invalid.
2. `loadTableInfo` method is only used in `SYNC` and `DBMetas` methods, `SYNC` should pass the session's context, while `DBMetas` has no problem passing `engine.defaultContext`.

All in all, I think this change should not affect other function.

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2297
Co-authored-by: LinkinStars <linkinstar@foxmail.com>
Co-committed-by: LinkinStars <linkinstar@foxmail.com>
2023-07-14 07:35:35 +00:00