[question] add isIndexed property #386

Closed
opened 2025-12-29 15:30:40 +01:00 by adam · 1 comment
Owner

Originally created by @idsky2 on GitHub (Apr 13, 2022).

In CoreData it is possible to set isIndexed to improve searches on a field.
I don't see any way to do that with the CoreStore @Field syntax.

Originally created by @idsky2 on GitHub (Apr 13, 2022). In CoreData it is possible to set isIndexed to improve searches on a field. I don't see any way to do that with the CoreStore @Field syntax.
adam added the question label 2025-12-29 15:30:40 +01:00
adam closed this issue 2025-12-29 15:30:41 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Apr 14, 2022):

It's not set on the @Field level, but the schema level:

let dataStack = DataStack(
    CoreStoreSchema(
        modelVersion: "V1",
        entities: [
            Entity<Animal>("Animal"),
            Entity<Dog>("Dog", indexes: [[\Dog.$nickname, \Dog.$age]]),
            Entity<Person>("Person")
        ]
    )
)
@JohnEstropia commented on GitHub (Apr 14, 2022): It's not set on the `@Field` level, but the schema level: ```swift let dataStack = DataStack( CoreStoreSchema( modelVersion: "V1", entities: [ Entity<Animal>("Animal"), Entity<Dog>("Dog", indexes: [[\Dog.$nickname, \Dog.$age]]), Entity<Person>("Person") ] ) ) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#386