Skip to content

Local Information

Offline stores can expose information about whether or not entities and relationships are local.

Entities

Entities are referred to as local when they are created or modified offline, as the changes exist only locally on the device. An offline store exposes information about whether or not entities are local. The following code fragment demonstrates how to query for all tracks with a filter to retrieve only tracks that are created or updated locally:

let query = DataQuery().filter(OfflineQueryFunction.isLocal())
let tracks = try eventService.fetchTracks(matching: query)

/// Assuming there is at least one local track
let track = tracks.first!

/// This shows how to check if an entity is local
if track.isLocal {
    /// Handle the track
    ...
}

Relationships

Relationships are referred to as local when they are created or modified offline, as the changes exist only locally on the device.

Note

Currently there is no support for querying whether a relationship is local.


Last update: October 30, 2020