Commit Graph

2441 Commits

Author SHA1 Message Date
Jinzhu 83530ec659 Fix delete order by clause when counting, close #4478 2021-07-13 21:17:43 +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 c73fe96cfd Fix scan into decimal.Decimal, close #4457 2021-07-13 19:59:31 +08:00
Jinzhu b616d810eb Fix scan single value to custom type, close #4501 2021-07-13 19:29:10 +08:00
Jinzhu 76cd73cb82 Fix wipes out MySQL global variables from the query, close #4515 2021-07-13 18:48:43 +08:00
Jinzhu 2ec7043818 Respect update permission for OnConflict Create 2021-07-13 18:04:42 +08:00
Burak Demirpolat 0329b800b0
slightly better callback warning (#4495) 2021-07-13 16:38:44 +08:00
wangyuehong 80497f27a6
title foreign schema for many2many to avoid panic (#4496)
Co-authored-by: yuehong.wang <yuehong.wang@dena.jp>
2021-07-13 16:36:22 +08:00
shiyu7 16579e00c6
fix: fix race issue in prepare method (#4487) 2021-07-01 06:27:12 +08:00
Jason Lee 6d64e31965
Merge pull request #4479 from wuwenchi/master
Fix document for Pluck's usage #4473
2021-06-27 11:29:20 +08:00
wuwenchi 8bd8d38fe9 Fix Pluck's usage #4473 2021-06-26 21:23:16 +08:00
Jinzhu 8e67a08774 Fix Scopes with Row, close #4465 2021-06-18 15:38:20 +08:00
Jinzhu 3226937f68 Fix calc gormSourceDir, close #4456 2021-06-13 10:32:03 +08:00
kalle (jag) 25b9f2e26a
Added return names to logger.Interface.Trace (#4450) 2021-06-11 21:51:40 +08:00
Tony a0bddccfe1
Use count(*) instead of count(1) include NULL and non-NULL rows(SQL-92). (#4453) 2021-06-11 21:51:18 +08:00
Jinzhu 5b65b02805 Update tests go.mod 2021-06-11 16:00:26 +08:00
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