DataLayer Module

Transaction Editor

  • A DataStoreTransaction, a ~Copyable struct passed borrowing to a DataLayer.TransactionBlock given to DataLayer.transactionally(execute:).

    It wraps a pending DataStore edit session, offering the write helpers (apply, put, putAll, remove, clear) and commit as synchronous methods.

    It conforms to DataItemExtractor, so all the typed getters of that protocol (get(key:as:), getArray(key:of:), …) and of JSONPathExtractable (extract(path:as:), …) are available directly on the transaction, on top of the getDataItem(key:) read requirement.

    Note

    DataStoreTransaction is noncopyable and is passed borrowing to the TransactionBlock, so it cannot be copied, stored in a property, or captured by an escaping closure. It is only valid for the duration of the block.
    See more

    Declaration

    Swift

    public struct DataStoreTransaction : ~Copyable, DataItemExtractor