Commit Graph

194 Commits

Author SHA1 Message Date
daheige 41ac73b6a1 update comment for ConvertSliceOfMapToValuesForCreate func 2021-07-28 18:56:39 +08:00
heige 5115813c50
Fix preload fmt.Errorf formatter (#4531) 2021-07-28 18:50:08 +08:00
Jinzhu d4f3c109d6 Fix OnConflict with one column, close #4370 2021-07-13 21:29:31 +08:00
Jinzhu 52b72d7ef2 Add error explanations when preloading assocations w/o foreign fields, close #4356 2021-07-13 21:00:13 +08:00
Jinzhu b13732c450 Fix invalid preload SQL when no data found, close #4443 2021-07-13 20:23:05 +08:00
Jinzhu 2ec7043818 Respect update permission for OnConflict Create 2021-07-13 18:04:42 +08:00
Jinzhu 8e67a08774 Fix Scopes with Row, close #4465 2021-06-18 15:38:20 +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
Jinzhu 6951be0284 Allow customize clauses 2021-04-28 17:19:30 +08:00
Jinzhu 7701c88507 Assign transaction error to db 2021-04-16 19:27:23 +08:00
Jinzhu d483ffa45c Fix Preload with nil pointer 2021-04-15 10:37:05 +08:00
heige 74e7a9ca07
Optimize reflect value length and method (#4280)
* Respect ignore migration when add column (#4276)

continue https://github.com/go-gorm/gorm/pull/4028

* feat: Optimal value type acquisition for v (#4278)

* feat: optimize relect value length and value

* feat: optimize ConvertSliceOfMapToValuesForCreate method

Co-authored-by: yrong1997 <yrong1997@gmail.com>
2021-04-14 13:00:54 +08:00
Jinzhu 220349ccf2 Fix omit associations, close #4161 2021-03-19 15:15:26 +08:00
Jinzhu 27bb9137d3 Refactor OnConflict.UpdateALl 2021-03-18 11:44:20 +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
Sivchari adf85d5b82
change the method of initializing slice (#4097)
* change the method of initializing slice and fixed the length to be specified as 0

* keep the association.go code in the var group

* keep the association.go code in the var group

* change to initializing in var group
2021-03-04 19:44:15 +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 eb9a704fda Fix update UpdatedAt when full saving associations, close #4115 2021-02-26 17:11:25 +08:00
Jinzhu 940da051a7 Skip nested associations when create data with Select, close #4108 2021-02-23 19:35:24 +08:00
Jinzhu 883c32e59a Support Unscoped when delete with selected associations, close #4062 2021-02-07 14:36:27 +08:00
Jinzhu deff0594ee Save associations based on creatable/updatable permission, close #4056 2021-02-07 14:24:11 +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 4a15540504 SkipDefaultTransaction skip CreateInBatches transaction 2021-01-18 11:43:42 +08:00
Jinzhu 59fa07953c Preload with settings, close #3945 2021-01-15 17:15:59 +08:00
Jinzhu de850edb4f Fix Change UpdatedAt to current time when doing OnConflict UpdateAll 2021-01-11 19:16:47 +08:00
Jinzhu 7ebb320f3e Allow customize join table's table in callback 2021-01-10 14:58:54 +08:00
Jinzhu d888c799d7 Change UpdatedAt to current time when doing OnConflict UpdateAll 2021-01-08 19:20:42 +08:00
Jinzhu 6d260a86bd Fix Set/Get settings when saving associations, close #3908 2021-01-05 21:12:31 +08:00
Jinzhu 60b769c2c8 OnConflict UpdateAll includes fields that specified default values via tag 2021-01-04 15:13:56 +08:00
Jinzhu 79864af9ff Allow customize auto increment increment 2020-12-30 11:16:40 +08:00
Jinzhu 77bf4aecc6 Create associations w/o nested transaction option 2020-12-18 13:25:52 +08:00
Jinzhu 0f00493c50 Continue to update tracking fields even not selected with Select, but skip them if omited with Omit, fix #3856 2020-12-15 11:18:29 +08:00
Jinzhu e1952924e2 Support named Joins, close #3833 2020-12-07 10:31:06 +08:00
Andrei Baibaratsky f2321ca164
Fixed creation of associated records with composite primary keys (go-gorm#3817) (#3818) 2020-12-03 15:00:26 +08:00
Jinzhu 6186a4daa7 allow SkipHooks when preload & save associations 2020-11-20 16:56:52 +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 e3b4e0418f Inherit SkipHooks option when preloading associations, close #3772 2020-11-20 15:11:47 +08:00
Jinzhu a1a30c38de Allow to omit fields when upsert associations, close #3762 2020-11-18 19:06:49 +08:00
Jinzhu 54b80b18bc Allow to omit fields in associations, close #3752 2020-11-17 21:49:40 +08:00
Jinzhu 50df9da6a1 Allow to skip associations when creating join table for many2many, close #3605 2020-11-17 20:24:08 +08:00
Jinzhu 9df9f7688b Change UpdatingColumn to SkipHooks 2020-11-17 17:49:43 +08:00
Jinzhu 26504f5cae Use NewDB to replace WithConditions for Session 2020-11-17 16:28:37 +08:00
Jinzhu f6e1786ca2 Add skip hooks support 2020-11-17 15:19:58 +08:00