58 Commits

Author SHA1 Message Date
abhijeet45
0daaf1747c
fix: AfterQuery using safer right trim while clearing from clause's join added as part of https://github.com/go-gorm/gorm/pull/7027 (#7153)
Co-authored-by: Abhijeet Bhowmik <abhijeet.bhowmik@cambiumnetworks.com>
2024-08-22 19:03:42 +08:00
kkocdko
bc49365de2
Faster utils.FileWithLineNum (#6981)
* faster FileWithLineNum

* tweak caller skip count
2024-04-22 14:43:02 +08:00
M Dmitry
d81ae6f701
Fixed: panic on nullable value with multiple foreign key usage (#6839)
See: https://github.com/go-gorm/playground/pull/537
2024-02-19 11:42:25 +08:00
Jacky
0123dd4509
fix: ignore .gen.go suffix in logger to get the real caller when using gen #6697 (#6785) 2024-01-12 17:09:22 +08:00
Alexis Viscogliosi
a2cac75218
feature: bring custom type and id column name to polymorphism (#6716)
* feature: bring custom type and id column name to polymorphism

* relationship: better returns for hasPolymorphicRelation

* fix: tests
2023-12-15 16:36:08 +08:00
Mathias Zeller
12ba285a52
*datatypes.JSON in model causes panic on tx.Statement.Changed (#6611)
* do not panic on nil

* more explanation in comments

* get things compact
2023-10-10 14:46:32 +08:00
Johannes Riecken
7dd702d379
Fix incorrect documentation comment (has many -> has one) (#6382) 2023-06-07 15:02:30 +08:00
Cr
8bf1f269cf
feat: support nested join (#6067)
* feat: support nested join

* fix: empty rel value
2023-03-10 17:21:56 +08:00
Saeid Kanishka
85eaf9eeda
feat: Unique Constraint Violation error translator for different drivers (#6004)
* feat: duplicated key error translator for different drivers

* test: removed the dependency

* test: fixed broken tests

* refactor: added ErrorTransltor interface

* style: applied styler

---------

Co-authored-by: Saeid Saeidee <s.saeidee@sensysgatso.com>
2023-03-06 14:03:31 +08:00
kvii
b6836c2d3e
fix bug in windows (#5844)
* fix bug in windows

* fix file name bug

* test in unix like platform
2022-11-21 10:48:13 +08:00
kvii
871f1de6b9
fix logger path bug (#5836) 2022-11-05 11:52:08 +08:00
jessetang
fb640cf7da
test(utils): add utils unit test (#5834) 2022-11-05 08:38:14 +08:00
Jinzhu
aa4312ee74 Don't display any GORM related package path as source 2022-10-17 17:01:42 +08:00
Jinzhu
34fbe84580 Add TableName with NamingStrategy support, close #5726 2022-10-07 21:18:37 +08:00
Cr
f223279384
chore: fix gorm tag (#5577) 2022-08-10 11:03:42 +08:00
alingse
099813bf11
Adjust ToStringKey use unpack params, fix pass []any as any in variadic function (#5500)
* fix pass []any as any in variadic function

* add .vscode to gitignore
2022-07-14 20:05:22 +08:00
Cr
d402765f69
test: fix utils.AssertEqual (#5172) 2022-03-18 20:11:23 +08:00
chenrui
9b9ae325bb fix: circular reference save, close #5140
commit 2ac099a37ac7bd74f0a98a6fdc42cc8527404144
Author: Jinzhu <wosmvp@gmail.com>
Date:   Thu Mar 17 23:49:21 2022 +0800

    Refactor #5140

commit 6e3ca2d1aa09943dcfb5d9a4b93bea28212f71be
Author: a631807682 <631807682@qq.com>
Date:   Sun Mar 13 12:52:08 2022 +0800

    test: add test for LoadOrStoreVisitMap

commit 9d5c68e41000fd15dea124797dd5f2656bf6b304
Author: chenrui <chenrui@jingdaka.com>
Date:   Thu Mar 10 20:33:47 2022 +0800

    chore: add more comment

commit bfffefb179c883389b72bef8f04469c0a8418043
Author: chenrui <chenrui@jingdaka.com>
Date:   Thu Mar 10 20:28:48 2022 +0800

    fix: should check values has been saved instead of rel.Name

commit e55cdfa4b3fbcf8b80baf009e8ddb2e40d471494
Author: chenrui <chenrui@jingdaka.com>
Date:   Tue Mar 8 17:48:01 2022 +0800

    chore: go lint

commit fe4715c5bd4ac28950c97dded9848710d8becb88
Author: chenrui <chenrui@jingdaka.com>
Date:   Tue Mar 8 17:27:24 2022 +0800

    chore: add test comment

commit 326862f3f8980482a09d7d1a7f4d1011bb8a7c59
Author: chenrui <chenrui@jingdaka.com>
Date:   Tue Mar 8 17:22:33 2022 +0800

    fix: circular reference save
2022-03-17 23:53:31 +08:00
Mikhail Faraponov
2990790fbc
Use WriteByte for single byte operations (#5167)
Co-authored-by: Mikhail Faraponov <mikefaraponov@Mikhails-MacBook-Pro.local>
2022-03-17 22:54:30 +08:00
Qt
7837fb6fa0
fix typo in TxCommitter interface comment & improve CheckTruth, chek val empty first (#5094)
* fix typo in TxCommitter interface comment

* improve CheckTruth, chek val empty first
2022-02-20 21:19:15 +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
kinggo
b47cf57f5e
ci: add gofumpt check in reviewdog (#4973) 2022-01-06 15:02:53 +08:00
Jinzhu
8627634959 Fix create associations with zero primary key, close #4890 2021-12-02 10:20:16 +08:00
Jinzhu
27e2753c9d Fix create duplicated value when updating nested has many relationship, close #4796 2021-11-29 18:43:39 +08:00
Jinzhu
e1b4c066a8 Fix FullSaveAssociations, close #4874 2021-11-29 11:02:44 +08:00
Jinzhu
835d7bde59 Add returning support to delete 2021-10-28 07:56:55 +08:00
Paras Waykole
5d91ddac8c
fixed belongs_to & has_one reversed if field same (proper fix) (#4694)
* fixed belongs_to & has_one reversed if field same

* hasmany same foreign key bug fixed and test added

* belongsToSameForeignKey fixed and reverted old fix
2021-10-08 10:59:55 +08:00
Jinzhu
d41fb3acdc Refactor dummy driver QuoteTo method 2021-09-11 16:22:35 +08:00
Adrien Carreira
52cc438d07 JoinsOn unit test + use all primary keys 2021-09-06 20:13:20 +08:00
Jinzhu
3226937f68 Fix calc gormSourceDir, close #4456 2021-06-13 10:32:03 +08:00
heige
50e85e14d4
Code optimize (#4415)
* optimize gormSourceDir replace

* fmt.Errorf adjust and Optimize for-break

* strings trim

* feat: avoid using the same name field and if..else optimization adjustment

* optimization callbacks/create.go Create func if...else logic

* fix: callbacks/create.go Create func

* fix FileWithLineNum func and add gormSourceDir unit test

* remove debug print and utils_filenum_test.go
2021-06-10 10:21:28 +08:00
Paras Waykole
8f7f3ad315
fixed belongs_to & has_one reversed if field same (#4343) 2021-05-05 07:57:54 +08:00
Jinzhu
70a7bd52ca Support delete associations with Select when deleting 2020-09-10 21:46:18 +08:00
aimuz
9a101c8a08
fmt.Sprint() to strconv.Format (#3354) 2020-09-01 21:03:37 +08:00
Jinzhu
d50dbb0896 Fix check valid db name, close #3315 2020-08-27 19:15:40 +08:00
Jinzhu
dc48e04896 Fix nested embedded struct, close #3278 2020-08-18 11:21:40 +08:00
Jinzhu
58e3241544 Fix Select with specific symbol, close #3158 2020-07-17 11:06:20 +08:00
Jinzhu
4456df7a5d Lint with golangci-lint 2020-07-16 11:27:12 +08:00
Jinzhu
0790ff6937 Update tests helper to check time 2020-07-09 09:42:27 +08:00
Jinzhu
619cd332ec Add index priority supports 2020-07-08 17:59:40 +08:00
Jinzhu
b5725940e9 Test Select with Update Struct 2020-07-06 11:20:43 +08:00
Jinzhu
f5566288de Add SetColumn, Changed method 2020-06-30 16:53:54 +08:00
Jinzhu
a1e35bdc94 Support merge batch data some having primary values 2020-06-20 16:52:15 +08:00
Jinzhu
4f19e2a7b3 Test ForeignKeyConstraints 2020-06-20 01:20:18 +08:00
Jinzhu
31a0553b82 Fix FileWithLineNum on windows 2020-06-07 18:37:05 +08:00
Jinzhu
9934207c42 Fix logger panic on windows 2020-06-03 14:39:36 +08:00
Jinzhu
8bb05a5a69 Refactor tests files 2020-06-02 10:50:38 +08:00
Jinzhu
590f622674 Refactor create tests 2020-05-23 22:32:16 +08:00
Jinzhu
5ec4fee797 Don't preload if foreign keys zero 2020-05-23 21:09:03 +08:00
Jinzhu
42aae57240 Test Preload for BelongsTo/HasOne/HasMany 2020-05-14 14:41:33 +08:00