Joel Nordell
8c0c82e887
Remove the name cache from NamingStrategy.
2021-02-10 11:14:21 -06:00
Joel Nordell
403967a34c
Refactor NamingStrategy tests to add more assertions about how and when Replacers get called.
2021-02-08 11:32:41 -06:00
Joel Nordell
4d33b2f584
Move sync.Map from global variable into member of NamingStrategy.
...
This maintains backward compatibility by making the smap optional - the
NamingStrategy still works if it is nil. gorm.Open activates it by
calling Init() if the given Namer is a schema.NamingStrategy.
Also, this changes the key stored in the smap to be the original name,
instead of the replaced name.
2021-02-08 10:52:06 -06:00
Joel Nordell
96fe56218b
Add NoLowerCase option to skip the snake_casing of names.
2021-02-02 16:32:01 -06:00
Joel Nordell
2abab3cf60
Change NameReplacer to an interface, allowing custom Replacers.
2021-02-02 16:22:02 -06:00
Jinzhu
8f37cb0195
Make has to be a const, close #4024
2021-02-01 10:42:13 +08:00
Jinzhu
db0cc4d60b
Fix too long foreign key/checker names, close #4026
2021-02-01 10:37:12 +08:00
Jinzhu
7598204dc3
Support FullSaveAssociations
for association mode, close #4010
2021-01-29 16:55:26 +08:00
Jinzhu
6e3ac74b7e
Fix preloading all associations together with nested associations, close #4016
2021-01-28 20:18:01 +08:00
David Harkness
4267df02af
Fix typo in README ( #4012 )
2021-01-28 10:21:58 +08:00
Jinzhu
8500380e60
Add name checker test, close #4007
2021-01-27 17:45:59 +08:00
Ben
cc61202fe2
retrieving gorm object support pointer ( #4006 )
2021-01-27 11:50:15 +08:00
Jinzhu
81aa949105
Remove the uncessary reflect.Ptr
2021-01-27 11:48:47 +08:00
rorschach
ba59065024
retrieving gorm object support pointer
2021-01-27 11:48:47 +08:00
Manyanda Chitimbo
f6308ed223
refactor: fix typo in tests.yml ( #4005 )
2021-01-27 11:18:39 +08:00
Jinzhu
7f198ead0e
Refactor nested preloading associations, close #3970
v1.20.12
2021-01-26 16:33:19 +08:00
Jinzhu
08678106a4
Support replace associations without the creation in association mode, close #3937
2021-01-26 14:34:21 +08:00
Jinzhu
916338a9e1
Test migrate constraints, close #3986
2021-01-26 13:39:34 +08:00
Jinzhu
59c01b7943
Make migrator works with dbresolver, close #3992
2021-01-25 10:30:57 +08:00
Jinzhu
f8bd4c4875
Don't create index if there are error exist, close #3976
2021-01-24 10:23:04 +08:00
Jinzhu
35ebfe6874
Support group conditions with single OR condition
2021-01-20 18:24:05 +08:00
Jinzhu
9790103e68
Fix Where with empty struct, close #3966
2021-01-19 16:37:49 +08:00
Jinzhu
6095dbf939
Fix parse embedded relations, close #3964 , #3965
2021-01-19 15:40:04 +08:00
Jinzhu
3d87575e7e
make Count compatible with Select with Count func, close #3962
2021-01-18 19:43:04 +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
79628be2c2
Fix wrong RowsAffected if not data found
2021-01-14 16:01:23 +08:00
Lisa Casner
ce610a9560
title case schema name ( #3940 )
2021-01-13 13:05:05 +08:00
Jinzhu
de850edb4f
Fix Change UpdatedAt to current time when doing OnConflict UpdateAll
2021-01-11 19:16:47 +08:00
Jinzhu
b864a5457a
Allow foreign key following the default naming conventions, close #3928
v1.20.11
2021-01-10 17:32:17 +08:00
Jinzhu
fe553a7c1a
Fix prepared statement in transaction mode can't be shared in normal operations, close #3927
2021-01-10 16:46:06 +08:00
Jinzhu
7302c8a136
Fix tests and logger
2021-01-10 15:27:53 +08:00
Jinzhu
7ebb320f3e
Allow customize join table's table in callback
2021-01-10 14:58:54 +08:00
Qt
f9131e309d
reduce DB's Use method complexity and make it easier to understand ( #3930 )
2021-01-10 10:15:48 +08:00
Jinzhu
d888c799d7
Change UpdatedAt to current time when doing OnConflict UpdateAll
v1.20.10
2021-01-08 19:20:42 +08:00
Jinzhu
a5bfe2f39d
Keep Error for new Session
2021-01-07 11:45:40 +08:00
Jinzhu
bf0fd9bef6
Fix logger check LogLevel
2021-01-06 16:07:19 +08:00
Jinzhu
5e72cd9a2b
Add ErrPrimaryKeyRequired if schema has no primary key defined
2021-01-06 14:42:42 +08:00
Jinzhu
435bf70865
Add OnConflict OnConstraint support, close #3882
2021-01-05 21:31:51 +08:00
Jinzhu
6d260a86bd
Fix Set/Get settings when saving associations, close #3908
2021-01-05 21:12:31 +08:00
Jinzhu
53b3ebdd1d
Add invalid data error when building conditions
2021-01-05 21:01:16 +08:00
Jinzhu
00a785cd68
Don't use invalid value to build conditions, close #3912
2021-01-05 18:01:51 +08:00
Jinzhu
60b769c2c8
OnConflict UpdateAll includes fields that specified default values via tag
2021-01-04 15:13:56 +08:00
Philip Sahli
9b8d3b3a0f
fix typo ( #3911 )
2021-01-04 11:30:05 +08:00
Jinzhu
1b8cb07cf2
Allow Where select fields when searching with struct
2020-12-30 18:13:52 +08:00
Jinzhu
79864af9ff
Allow customize auto increment increment
2020-12-30 11:16:40 +08:00
Jinzhu
6c0ee2700a
Allow to use Valuer with Eq expression, #3899
2020-12-30 10:42:13 +08:00
Jinzhu
065787c54e
Compatible with with foreign key with ID suffix #3890
2020-12-28 18:20:55 +08:00
Jinzhu
8bf50a5592
Fix parse relations if only specfied References, close #3890
2020-12-28 17:58:12 +08:00
Jinzhu
ade0bd6d60
Fix SELECT with sql expression in some cases, close #3889
2020-12-28 10:40:30 +08:00