Corestore fetch over one to many with where clause #282

Open
opened 2025-12-29 15:28:09 +01:00 by adam · 1 comment
Owner

Originally created by @Pratik-Sodha on GitHub (Jul 19, 2019).

Screen Shot 2019-07-19 at 4 42 14 PM

I have above structure.

Description : Server entity have three attributes.
Name - Type
localId - UUID
serverId - UUID
SyncFlag - Int16.

SyncFlag have three possible values. [1,2,3]. 1 for insert, 2 for update and 3 for delete.

Now, requirement is that, Want to fetch one employee with related projects using employee serverId. But not want that projects which project status is deleted.

Any help appreciated :)

Thank you.

Originally created by @Pratik-Sodha on GitHub (Jul 19, 2019). ![Screen Shot 2019-07-19 at 4 42 14 PM](https://user-images.githubusercontent.com/38202068/61531544-bef90680-aa44-11e9-8b8e-78fe617d07cf.png) I have above structure. Description : **Server** entity have three attributes. **Name** - **Type** _localId_ - UUID _serverId_ - UUID _SyncFlag_ - Int16. SyncFlag have three possible values. [1,2,3]. 1 for insert, 2 for update and 3 for delete. Now, requirement is that, Want to fetch one employee with related projects using employee serverId. But not want that projects which project status is deleted. Any help appreciated :) Thank you.
adam added the question label 2025-12-29 15:28:09 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Jul 28, 2019):

If I understood you correctly, I think it's something like this:

let serverId = // ...
let employee = dataStack.fetchAll(
    From<Employee>()
        .where((\.sync ~ \.serverId).any() == serverId)
)
@JohnEstropia commented on GitHub (Jul 28, 2019): If I understood you correctly, I think it's something like this: ```swift let serverId = // ... let employee = dataStack.fetchAll( From<Employee>() .where((\.sync ~ \.serverId).any() == serverId) ) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#282