SwiftprotocolSwiftData

protocol SwiftData.DataStore

Members 20

  1. associatedtypeassociatedtype Configuration
  2. associatedtypeassociatedtype Snapshot
  3. funcmethod descriptor for cachedSnapshots(for: [SwiftData.PersistentIdentifier], editingState: SwiftData.EditingState) throws -> [SwiftData.PersistentIdentifier : A.Snapshot]
  4. funccachedSnapshots(for: [SwiftData.PersistentIdentifier], editingState: SwiftData.EditingState) throws -> [SwiftData.PersistentIdentifier : A.Snapshot]
  5. funcmethod descriptor for erase() throws -> ()
  6. funcerase() throws -> ()
  7. funcmethod descriptor for fetch<A where A1: SwiftData.PersistentModel>(SwiftData.DataStoreFetchRequest<A1>) throws -> SwiftData.DataStoreFetchResult<A1, A.Snapshot>
  8. funcmethod descriptor for fetchCount<A where A1: SwiftData.PersistentModel>(SwiftData.DataStoreFetchRequest<A1>) throws -> Int
  9. funcfetchCount<A where A1: SwiftData.PersistentModel>(SwiftData.DataStoreFetchRequest<A1>) throws -> Int
  10. funcmethod descriptor for fetchIdentifiers<A where A1: SwiftData.PersistentModel>(SwiftData.DataStoreFetchRequest<A1>) throws -> [SwiftData.PersistentIdentifier]
  11. funcfetchIdentifiers<A where A1: SwiftData.PersistentModel>(SwiftData.DataStoreFetchRequest<A1>) throws -> [SwiftData.PersistentIdentifier]
  12. funcmethod descriptor for initializeState(for: SwiftData.EditingState) -> ()
  13. funcinitializeState(for: SwiftData.EditingState) -> ()
  14. funcmethod descriptor for invalidateState(for: SwiftData.EditingState) -> ()
  15. funcinvalidateState(for: SwiftData.EditingState) -> ()
  16. funcmethod descriptor for save(SwiftData.DataStoreSaveChangesRequest<A.Snapshot>) throws -> SwiftData.DataStoreSaveChangesResult<A.Snapshot>
  17. initmethod descriptor for init(_: A.Configuration, migrationPlan: SwiftData.SchemaMigrationPlan.Type?) throws -> A
  18. varvar configuration: A.Configuration { get }
  19. varvar identifier: String { get }
  20. varvar schema: SwiftData.Schema { get }
protocol DataStore: AnyObject where Self == Self.Configuration.Store, Self.Configuration: SwiftData.DataStoreConfiguration, Self.Snapshot: SwiftData.DataStoreSnapshot {
    associatedtype Configuration
    associatedtype Snapshot

    init(_: Self.Configuration, migrationPlan: (any SwiftData.SchemaMigrationPlan.Type)?) throws

    var configuration: Self.Configuration {
        get
    }
    var identifier: Swift.String {
        get
    }
    var schema: SwiftData.Schema {
        get
    }

    func erase() throws
    func fetch<A1>(_: SwiftData.DataStoreFetchRequest<A1>) throws -> SwiftData.DataStoreFetchResult<A1, Self.Snapshot> where A1: SwiftData.PersistentModel
    func fetchCount<A1>(_: SwiftData.DataStoreFetchRequest<A1>) throws -> Swift.Int where A1: SwiftData.PersistentModel
    func fetchIdentifiers<A1>(_: SwiftData.DataStoreFetchRequest<A1>) throws -> [SwiftData.PersistentIdentifier] where A1: SwiftData.PersistentModel
    func save(_: SwiftData.DataStoreSaveChangesRequest<Self.Snapshot>) throws -> SwiftData.DataStoreSaveChangesResult<Self.Snapshot>
    func initializeState(for: SwiftData.EditingState)
    func invalidateState(for: SwiftData.EditingState)
    func cachedSnapshots(for: [SwiftData.PersistentIdentifier], editingState: SwiftData.EditingState) throws -> [SwiftData.PersistentIdentifier : Self.Snapshot]
}
extension SwiftData.DataStore {
    func fetchCount<A1>(_: SwiftData.DataStoreFetchRequest<A1>) throws -> Swift.Int where A1: SwiftData.PersistentModel
    func cachedSnapshots(for: [SwiftData.PersistentIdentifier], editingState: SwiftData.EditingState) throws -> [SwiftData.PersistentIdentifier : Self.Snapshot]
    func initializeState(for: SwiftData.EditingState)
    func invalidateState(for: SwiftData.EditingState)
    func fetchIdentifiers<A1>(_: SwiftData.DataStoreFetchRequest<A1>) throws -> [SwiftData.PersistentIdentifier] where A1: SwiftData.PersistentModel
    func erase() throws
}