Commit Graph

2524 Commits

Author SHA1 Message Date
Jinzhu e425ed6f6a Update tests go.mod 2021-06-10 20:26:21 +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
liamrfell 00b252559f
Fix: FirstOrCreate slice out of bounds error when using 'Assigns' (#4436)
Co-authored-by: Liam Fell <liam@lot.to>
2021-06-07 10:39:24 +08:00
Vitaliy Shein dd8bf88eb9
add Target where clause for on conflict (#4442)
Co-authored-by: Vitaliy Shein <vitaliy.shein@thebricks.com>
2021-06-07 10:39:00 +08:00
s-takehana cf079b8b7d
Update version in `tests.yml` (#4432) 2021-06-02 09:58:22 +08:00
Jinzhu 810058cd55 Fix soft delete with Update 2021-06-01 18:34:38 +08:00
Jinzhu 9abac96546 Fix Eq, Neq support slice of data 2021-05-31 17:21:27 +08:00
Jinzhu 14e96080d8 Eq, Neq support slice of data 2021-05-31 15:25:38 +08:00
heyanfu 363f9b7863
golint standard (#4421) 2021-05-31 10:08:06 +08:00
Ikko Ashimine bcf2b385a4
Fix typo in associations_test.go (#4407)
occured -> occurred
2021-05-27 17:40:28 +08:00
Brenda Wallace ac722c16f9
Small grammar fix in error message (#4406) 2021-05-24 10:23:34 +08:00
Jinzhu ea1bce3771 Only check struct value can address or not 2021-05-23 11:21:56 +08:00
Paras Waykole 79f427d862
fixed has_many stopped working if field names are identical (#4387)
* fixed belongs_to & has_one reversed if field same

* hasmany same foreign key bug fixed and test added
2021-05-19 16:05:29 +08:00
Atreya cf93b16730
Fix ErrInvalidTransaction error message (#4380) 2021-05-17 15:53:48 +08:00
Jinzhu 92c3ba9dcc Fix create new db sessions in scopes 2021-05-17 15:36:07 +08:00
Chen Quan a480bd8545
Update Optimize schema (#4364) 2021-05-10 09:51:50 +08:00
Jinzhu 6b7abc54a2 Fix tests 2021-05-06 13:06:31 +08:00
Jinzhu 2aca96d147 test ignore migration, close #4314, #4315 2021-05-05 08:26:48 +08:00
我的我的 3f359eab9b
slim trace if depth (#4346)
Co-authored-by: gogs <guzzsek@gmail.com>
2021-05-05 08:14:40 +08:00
Paras Waykole 8f7f3ad315
fixed belongs_to & has_one reversed if field same (#4343) 2021-05-05 07:57:54 +08:00
Jinzhu 70e93e73d8 Check data type if copyable before change reference field's type 2021-04-30 16:35:55 +08:00
Karolos Lykos f0d0bbbc10
Added missing white space (#4330)
* Added missing white space

* Added missing white space

* Added missing white space
2021-04-29 07:15:37 +08:00
Jinzhu 6951be0284 Allow customize clauses 2021-04-28 17:19:30 +08:00
Jinzhu 82cb4ebfe2 Fix overwrite Statement in scopes 2021-04-22 13:12:20 +08:00
Sky34gl3 a855fe6402
Fixed naming longer than 64 characters (#4310)
Co-authored-by: Mickael MAUGER <mickael.mauger@almerys.com>
2021-04-22 13:11:19 +08:00
Jinzhu d327926425 Check ReflectValue.CanAddr before set field value 2021-04-19 21:37:38 +08:00
Chris Faulkner 15a46bc042
Fix some typos (#4294) 2021-04-19 21:03:39 +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
heige 5555b010dc
feat: Optimal value type acquisition for v (#4278) 2021-04-13 09:41:30 +08:00
yrong1997 d7911300f8
Respect ignore migration when add column (#4276)
continue https://github.com/go-gorm/gorm/pull/4028
2021-04-13 09:39:43 +08:00
Jinzhu d278ca49ef sort GORM options before apply 2021-04-09 11:43:24 +08:00
Jinzhu ad53074f1d Pass db error to new instance 2021-04-09 11:07:14 +08:00
Jinzhu f3bdfa8261 Add IgnoreRecordNotFoundError option for logger 2021-04-09 10:21:01 +08:00
Jinzhu 673053f56a Fix context cancel error, close #4259, close #4260 2021-04-09 10:21:01 +08:00
gavwu 8cfa9d98f0
Update field.go (#4228)
seems like the `if-else` branch do the same thing, so remove it
2021-04-02 09:56:38 +08:00
Jinzhu 33601dc72f Support Having w/o Group 2021-03-30 18:28:09 +08:00
Jinzhu 73c6d3e64e Add AfterInitialize error 2021-03-29 18:36:01 +08:00
Jinzhu 0eba7a9ed1 Fix apply option 2021-03-26 14:20:42 +08:00
Jinzhu a8b72546c1 Fix get database connection for prepared stmt, close #4214 2021-03-25 10:17:57 +08:00
Jinzhu 26e0c6fb69 skip test sqlserver due to it will raise data race for invalid sql 2021-03-24 17:12:30 +08:00
Jinzhu 88078e48d0 Remove sqlite_windows test case 2021-03-24 16:56:41 +08:00
Jinzhu 8204d0ada2 Update tests script 2021-03-24 16:44:51 +08:00
Jinzhu 704e53a774 Call scopes before parse model value, close #4209 2021-03-24 16:35:39 +08:00
Jinzhu 4d5cec8bdd Add golang 1.16 2021-03-24 14:22:36 +08:00
Genta Kamitani 26dd4c980a
Fix: FindInBatches ignores errors (#4203) 2021-03-22 14:11:07 +08:00
Jinzhu 8c92d9694a Fix to call Scopes with using Migrator 2021-03-19 16:34:51 +08:00
Jinzhu a9fe025ef5 Add GetDBConnector interface 2021-03-19 15:55:38 +08:00
Jinzhu 220349ccf2 Fix omit associations, close #4161 2021-03-19 15:15:26 +08:00