Evan Owen
4b91437c88
Treat partially zero compound foreign keys as an unset association
...
Currently when one value of a compound foreign key is null or zero,
preloading this association yields a panic ("reflect: call of
reflect.Value.Interface on zero Value") because we're attempting to
look up the identity values when any one of the columns is non-zero.
The fix here is to require each of the values to be non-zero or we
assume that the association is missing. This is not a very common
scenario to have in practice, but it's an edge case that's easy to fix
and resolves a use-case for me.
2020-11-02 19:04:55 -08:00
Jinzhu
1a526e6802
Fix NamingStrategy with embedded struct, close #3513
2020-09-24 11:32:38 +08:00
Jinzhu
2b510d6423
Don't create index for join table, close #3294
2020-08-21 15:40:50 +08:00
Jinzhu
dc48e04896
Fix nested embedded struct, close #3278
2020-08-18 11:21:40 +08:00
Jinzhu
2676fa4fb8
Remove autoincrement tag for join table, close #3217
2020-07-31 18:19:25 +08:00
Jinzhu
2ae0653af2
Fix ambiguous column when using same column name in join table, close #3120
2020-07-09 09:03:48 +08:00
Jinzhu
e986371a42
Rename package name
2020-06-02 09:18:01 +08:00
Jinzhu
b71171dd92
Add more preload tests
2020-06-02 01:34:00 +08:00
Jinzhu
e60a8d54ff
Test Nested Preload
2020-05-24 00:52:25 +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
20cb57b1ac
Add association Delete support
2020-05-20 02:03:43 +08:00
Jinzhu
59365b776b
Refacotr Preload
2020-05-18 13:07:11 +08:00
Jinzhu
56ca9a87e0
Add permission check when create associations
2020-04-16 10:29:18 +08:00
Jinzhu
ea0b13f7a3
Refactor ParseTagSetting
2020-02-22 07:59:09 +08:00
Jinzhu
14724ddeae
Add tests model definition and basic fields tests
2020-02-01 20:18:32 +08:00
Jinzhu
fd9b688084
Implement parse many2many relation
2020-02-01 18:02:19 +08:00
Jinzhu
eea78f3f30
Implement parse relationship architecture
2020-02-01 12:46:52 +08:00
Jinzhu
1079e17caf
Implement schema parser
2020-01-31 12:46:16 +08:00