Commit Graph

77 Commits

Author SHA1 Message Date
Cr 1935eb0adb
feat: support inner join (#5583)
* feat: support inner join

* test: mixed inner join and left join

* chore: code comment

* Update statement.go

Co-authored-by: Jinzhu <wosmvp@gmail.com>
2022-12-24 12:27:38 +08:00
Cr b2f42528a4
fix(Joins): args with select and omit (#5790)
* fix(Joins): args with select and omit

* chore: gofumpt style
2022-11-02 10:28:00 +08:00
Cr 19b8d37ae8
fix: preload with skip hooks (#5310) 2022-05-04 18:57:53 +08:00
huangcheng1 38a24606da fix: tables lost when joins exists in from clause, close #5218
commit 7f6a603afa26820e187489b5203f93adc513687c
Author: Jinzhu <wosmvp@gmail.com>
Date:   Sat Apr 2 17:26:48 2022 +0800

    Refactor #5218

commit 95d00e6ff2
Author: huangcheng1 <huangcheng1@sensetime.com>
Date:   Fri Apr 1 16:30:27 2022 +0800

    fix: tables lost when joins exists in from clause
2022-04-02 17:27:53 +08:00
Jinzhu ea8509b777 Use defer to close rows to avoid scan panic leak rows 2022-03-29 18:48:32 +08:00
chenrui 5431da8caf fix: preload panic when model and dest different close #5130
commit e8307b5ef5273519a32cd8e4fd29250d1c277f6e
Author: Jinzhu <wosmvp@gmail.com>
Date:   Fri Mar 18 13:37:22 2022 +0800

    Refactor #5130

commit 40cbba49f3
Author: chenrui <chenrui@jingdaka.com>
Date:   Sat Mar 5 17:36:56 2022 +0800

    test: fix test fail

commit 66d3f07829
Author: chenrui <chenrui@jingdaka.com>
Date:   Sat Mar 5 17:29:09 2022 +0800

    test: drop table and auto migrate

commit 7cbf019a93
Author: chenrui <chenrui@jingdaka.com>
Date:   Sat Mar 5 15:27:45 2022 +0800

    fix: preload panic when model and dest different
2022-03-18 13:38:46 +08:00
chenrui c2e36ebe62 fix: soft delete for join, close #5132
commit a83023bdfc0dc6eaccc6704b64ff6436c2fe7725
Author: Jinzhu <wosmvp@gmail.com>
Date:   Fri Mar 18 01:05:25 2022 +0800

    Refactor #5132

commit 8559f51102
Author: chenrui <chenrui@jingdaka.com>
Date:   Mon Mar 7 20:33:12 2022 +0800

    fix: should add deleted_at exprs for every joins

commit 2b7a1bdcf3
Author: chenrui <chenrui@jingdaka.com>
Date:   Mon Mar 7 14:46:48 2022 +0800

    test: move debug flag

commit ce13a2a7bc
Author: chenrui <chenrui@jingdaka.com>
Date:   Mon Mar 7 14:39:56 2022 +0800

    fix: soft delete for join.on
2022-03-18 01:09:20 +08:00
Jinzhu 6befa0c947 Refactor preload error check 2022-03-17 11:22:25 +08:00
Jinzhu 39d84cba5f Add serializer support (#5078)
* Update context

* Update GormFieldValuer

* Add Serializer

* Add Serializer Interface

* Refactor gorm field

* Refactor setter, valuer

* Add sync.Pool

* Fix test

* Add pool manager

* Fix pool manager

* Add poolInitializer

* Add Serializer Scan support

* Add Serializer Value method

* Add serializer test

* Finish Serializer

* Fix JSONSerializer for postgres

* Fix JSONSerializer for sqlserver

* Test serializer tag

* Add unixtime serializer

* Update go.mod
2022-02-19 17:02:53 +08:00
li-jin-gou c0bea447b9
fix: omit not work when use join (#5034) 2022-01-28 22:16:42 +08:00
liweitingwt 24026bf1fe
modify unscoped judge (#4929)
* modify unscoped judge

* modify unscoped judge

Co-authored-by: liweiting <liweiting1995@gmail.com>
2021-12-16 10:41:34 +08:00
kinggo e5bdd610c3
fix: save not use soft_delete (#4897)
* fix: Save not use soft_delete

* fix: save not use soft_delete

* fix: save not use soft_delete

* fix: save not use soft_delete

Co-authored-by: kinggo <>
2021-12-08 13:58:06 +08:00
Jinzhu 300a23fc31 Check rows.Close error, close #4891 2021-12-02 10:39:24 +08:00
Jinzhu ca7accdbf6 Fix preload all associations with inline conditions, close #4836 2021-11-08 19:47:10 +08:00
Jinzhu af3fbdc2fc Improve returning support 2021-10-26 22:40:14 +08:00
kinggo 418c60c83c
fixed: clauseSelect.Columns missed when use Join And execute multiple query. (#4757) 2021-10-09 16:55:45 +08:00
Jinzhu a16db07945 Refactor Join ON 2021-09-07 21:21:44 +08:00
Adrien Carreira c301aeb524 Refactor for readability 2021-09-06 20:13:20 +08:00
Adrien Carreira 52cc438d07 JoinsOn unit test + use all primary keys 2021-09-06 20:13:20 +08:00
Adrien Carreira 895c1178a0 Proposal, Add Specific on for Joins queries 2021-09-06 20:13:20 +08:00
heige 5115813c50
Fix preload fmt.Errorf formatter (#4531) 2021-07-28 18:50:08 +08:00
Jinzhu 6951be0284 Allow customize clauses 2021-04-28 17:19:30 +08:00
Jinzhu 2055e29eb8 Refactor nested preload all associations 2021-03-14 10:42:58 +08:00
ruozhixian c575a4e719 support to preload all children in multiple levels associations 2021-03-11 16:36:49 +08:00
Jinzhu a948c84607 Revert "Revert "Don't override the from clauses, close #4129" close #4139"
This reverts commit d6c23586ae.
2021-03-05 22:19:34 +08:00
Jinzhu d6c23586ae Revert "Don't override the from clauses, close #4129" close #4139
This reverts commit 664755270d.
2021-03-05 19:42:54 +08:00
Jinzhu 664755270d Don't override the from clauses, close #4129 2021-03-04 19:16:08 +08:00
Jinzhu 42999e9809 Fix overwrite preloading associations, close #4134 2021-03-04 18:28:32 +08:00
Jinzhu 4373aa01ab Don't call AfterFind hooks if no record found, close #4048 2021-02-07 12:44:59 +08:00
Jinzhu 6e3ac74b7e Fix preloading all associations together with nested associations, close #4016 2021-01-28 20:18:01 +08:00
Jinzhu 7f198ead0e Refactor nested preloading associations, close #3970 2021-01-26 16:33:19 +08:00
Jinzhu e1952924e2 Support named Joins, close #3833 2020-12-07 10:31:06 +08:00
Jinzhu dec8748512 Refactor QueryFields Option 2020-11-20 15:44:39 +08:00
Luis Guillermo Gómez 47ffd0bef4
Select all fields in SQL queries avoiding the SELECT * FROM (#3731)
* Select all fields in SQL queries avoiding the SELECT * FROM

* Select table name with fields in SQL queries

* Use QueryFields to execute the SQL query with all fields of the table
2020-11-20 15:38:25 +08:00
Jinzhu 9df9f7688b Change UpdatingColumn to SkipHooks 2020-11-17 17:49:43 +08:00
Jinzhu a9f54d53fb Don't preload when there are any error happened 2020-11-16 12:23:13 +08:00
Jinzhu 560d303e71 Fix Scan with soft delete, close #3712 2020-11-04 11:03:22 +08:00
Jinzhu ce8853e7a6 Add GormValuer interface support 2020-08-27 15:03:57 +08:00
Jinzhu 3a97639880 Fix unordered joins, close #3267 2020-08-23 10:45:10 +08:00
Jinzhu 045d5f8538 Fix count with join and no model, close #3255 2020-08-13 12:18:36 +08:00
Jinzhu dc299b900f Use specified table when preloading data with Join 2020-07-31 14:47:47 +08:00
Jinzhu 69d8111893 Fix panic when using invalid data, close #3193 2020-07-24 08:32:50 +08:00
Jinzhu a0477f94dd Allow Omit with Query, close #3165 2020-07-19 21:48:58 +08:00
Jinzhu a8655f7947 Fix auto select with smaller struct for slices 2020-07-09 12:15:35 +08:00
Jinzhu 9075b33620 Query with smaller struct 2020-07-01 08:56:21 +08:00
Jinzhu 5883490aa7 Select, Omit, Preload supports clause.Associations 2020-06-20 17:21:01 +08:00
Jinzhu 9f19378304 Grow SQL capacity to reduce allocation 2020-06-08 20:23:47 +08:00
Jinzhu aaf0725771 Refactor for performance 2020-06-08 17:21:26 +08:00
Jinzhu 1490a062db Refactor codebase and add benchmark test 2020-06-05 23:26:56 +08:00
Jinzhu 163200d05f Test Hooks 2020-06-05 20:24:15 +08:00