Commit Graph

31 Commits

Author SHA1 Message Date
Lunny Xiao 076858c1e5 Merge branch 'main' into lunny/postgres_for_update 2024-01-22 08:11:31 +00:00
Lunny Xiao 3344b42b4b Fix #2393 (#2395) (#2396)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2395
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2396
2024-01-15 14:51:06 +00:00
Lunny Xiao f1391d7b2f Use github.com/microsoft/go-mssqldb instead of old mssqldb repository (#2386)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2386
2023-12-31 15:29:01 +00:00
Lunny Xiao 2a4161d7a5 Fix mssql get indexes bug when collation is not default with collation test for mssql (#2387)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2387
2023-12-31 14:07:15 +00:00
Lunny Xiao 81c3905773 Implement update join (#2383)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2383
2023-12-30 10:21:39 +00:00
Lunny Xiao 4cde28ca21 Use any instead of interface{} (#2360)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2360
2023-10-28 10:59:32 +00:00
Lunny Xiao 607f715634 Move convert internal (#2355)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2355
2023-10-28 03:30:11 +00:00
Lunny Xiao 42553b7477 Remove cache features (#2347)
The cache feature is not used frequently but needs more time to maintain.
I think there are many machism to handle the cache out of ORM. So let's remove it.

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2347
2023-10-27 15:48:07 +00:00
Lunny Xiao 82faf6c301 start v2 (#2350)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2350
2023-10-27 14:27:46 +00:00
Lunny Xiao 05a8643056 Remove mymysql driver since it's unmaintained for a long time (#2349)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2349
2023-10-27 09:21:35 +00:00
Lunny Xiao 6ef0a7798f Fix bug when join with alias start with `a` (#2343)
Fix #2331

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2343
2023-10-25 11:01:46 +00:00
Lunny Xiao 8e2fda467f
enable for update test for postgres 2023-10-25 15:37:00 +08:00
Lunny Xiao 0f085408af some refactors for write functions (#2342)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2342
2023-10-25 07:11:18 +00:00
lng2020 dbe499091a Revert "Fix deleted tag attribute zeroTime is not DatabaseTZ (#2299)" (#2341)
Related #2339

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2341
Co-authored-by: lng2020 <nanguanlin6@gmail.com>
Co-committed-by: lng2020 <nanguanlin6@gmail.com>
2023-10-17 09:41:42 +00:00
FlyingOnion 551de3767c 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>
2023-09-20 02:07:03 +00:00
Ryan Liu ac88a5705a fix the error in mysql: unknown colType UNSIGNED FLOAT (#2143)
Error: unknown colType UNSIGNED FLOAT
in mysql 5.6.27 or 5.7.32

Fix #2123

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2143
Co-authored-by: Ryan Liu <azhai@126.com>
Co-committed-by: Ryan Liu <azhai@126.com>
2023-09-16 15:43:12 +00:00
6543 e5be0f4129 Remove dead code from session.SyncWithOptions() (#2323)
db7c264062/sync.go (L229-L231)

as oriIndex only is **not** nil if index.Equal(index2)

and index.Equal(index2) check if `oriIndex.Type == index.Type` ... so it always is false

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2323
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-committed-by: 6543 <6543@obermui.de>
2023-09-16 14:41:02 +00:00
Lunny Xiao 407375c9b4 Add test for max ( id ) (#2316)
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2316
2023-09-16 13:48:49 +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 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 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
Lunny Xiao f30dadfd02 move tests to a sereprated repository 2014-04-11 17:22:21 +08:00
Lunny Xiao 128db9c792 bug fixed and tests passed 2014-04-11 17:04:39 +08:00
Lunny Xiao 5080b2b571 Merge branch 'master' into dev
Conflicts:
	dialects/oracle.go
	dialects/postgres.go
	docs/QuickStart.md
	engine.go
	mysql.go
	session.go
	statement.go
	table.go
	tests/base_test.go
	xorm.go
	xorm/go.go
	xorm/reverse.go
2014-04-11 15:37:27 +08:00
Lunny Xiao e77fca31ae move tests to tests subdir & refactoring 2014-01-25 10:07:11 +08:00
Lunny Xiao 21c08ea09c move test files to tests/ subdir 2014-01-23 11:09:48 +08:00
Nash Tsai 52eef13832 add create mysql xorm_test3 db stmt to ddl 2014-01-14 18:22:21 +08:00
Lunny Xiao 4df43ffa0f new architecture 2014-01-07 17:33:27 +08:00
Nash Tsai ec06be3197 implemented ddl import 2013-12-04 18:39:22 +08:00