mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Selecting fields using key path with @Field models #402
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pinkplus on GitHub (Jan 31, 2023).
Let's say we have the following model, with fields defined using the
@Fieldproperty wrapper:The following query using key path will fail to compile:
This is surprising to me. The readme contains an example to query using key path, so I thought it should work.
I noticed one difference between my code and the example code. In the example code, the model is probably defined using
Value.Required(because it's doing.select(\.age)without$). On the other hand, my code uses the@Fieldproperty wrapper.I looked into the implementation of
From.select(). It seems to supportValueContainer, but notFieldContainer. I guess this is the reason -- is this intentional?@JohnEstropia commented on GitHub (Feb 1, 2023):
@pinkplus The demo app shows the syntax you need:
Admittedly,
queryAttributes()currently only supportingNSDictionaryas the type parameter is a bit clunky.@pinkplus commented on GitHub (Feb 4, 2023):
Hmm... Thanks.