DataStoreCategory
final public class DataStoreCategory : Category
extension DataStoreCategory: DataStoreBaseBehavior
extension DataStoreCategory: DefaultLogger
extension DataStoreCategory: Resettable
extension DataStoreCategory: DataStoreSubscribeBehavior
-
Always .dataStore
Declaration
Swift
public let categoryType: CategoryType
-
Adds
plugin
to the list of Plugins that implement functionality for this category.Declaration
Swift
public func add(plugin: DataStoreCategoryPlugin) throws
Parameters
plugin
The Plugin to add
-
Returns the added plugin with the specified
key
property.Declaration
Swift
public func getPlugin(for key: PluginKey) throws -> DataStoreCategoryPlugin
Parameters
key
The PluginKey (String) of the plugin to retrieve
Return Value
The wrapped plugin
-
Removes the plugin registered for
key
from the list of Plugins that implement functionality for this category. If no plugin has been added forkey
, no action is taken, making this method safe to call multiple times.Declaration
Swift
public func removePlugin(for key: PluginKey)
Parameters
key
The key used to
add
the plugin -
save(_:
Asynchronouswhere: ) Declaration
Swift
@discardableResult public func save<M: Model>(_ model: M, where condition: QueryPredicate? = nil) async throws -> M
-
query(_:
AsynchronousbyId: ) Declaration
Swift
public func query<M: Model>(_ modelType: M.Type, byId id: String) async throws -> M?
-
query(_:
AsynchronousbyIdentifier: ) Declaration
Swift
public func query<M: Model>(_ modelType: M.Type, byIdentifier id: String) async throws -> M? where M: ModelIdentifiable, M.IdentifierFormat == ModelIdentifierFormat.Default
-
query(_:
AsynchronousbyIdentifier: ) Declaration
Swift
public func query<M: Model>(_ modelType: M.Type, byIdentifier identifier: ModelIdentifier<M, M.IdentifierFormat>) async throws -> M? where M: ModelIdentifiable
-
query(_:
Asynchronouswhere: sort: paginate: ) Declaration
Swift
public func query<M: Model>(_ modelType: M.Type, where predicate: QueryPredicate? = nil, sort sortInput: QuerySortInput? = nil, paginate paginationInput: QueryPaginationInput? = nil) async throws -> [M]
-
delete(_:
Asynchronouswhere: ) Declaration
Swift
public func delete<M: Model>(_ model: M, where predicate: QueryPredicate? = nil) async throws
-
delete(_:
AsynchronouswithId: where: ) Declaration
Swift
public func delete<M: Model>(_ modelType: M.Type, withId id: String, where predicate: QueryPredicate? = nil) async throws
-
delete(_:
AsynchronouswithIdentifier: where: ) Declaration
Swift
public func delete<M: Model>(_ modelType: M.Type, withIdentifier id: String, where predicate: QueryPredicate? = nil) async throws where M: ModelIdentifiable, M.IdentifierFormat == ModelIdentifierFormat.Default
-
delete(_:
AsynchronouswithIdentifier: where: ) Declaration
Swift
public func delete<M: Model>(_ modelType: M.Type, withIdentifier id: ModelIdentifier<M, M.IdentifierFormat>, where predicate: QueryPredicate? = nil) async throws where M: ModelIdentifiable
-
delete(_:
Asynchronouswhere: ) Declaration
Swift
public func delete<M: Model>(_ modelType: M.Type, where predicate: QueryPredicate) async throws
-
start()
AsynchronousDeclaration
Swift
public func start() async throws
-
stop()
AsynchronousDeclaration
Swift
public func stop() async throws
-
clear()
AsynchronousDeclaration
Swift
public func clear() async throws
-
Declaration
Swift
public static var log: Logger { get }
-
Declaration
Swift
public var log: Logger { get }
-
reset()
AsynchronousDeclaration
Swift
public func reset() async
-
Declaration
Swift
public func observe<M>(_ modelType: M.Type) -> AmplifyAsyncThrowingSequence<MutationEvent> where M : Model
-
Declaration
Swift
public func observeQuery<M: Model>(for modelType: M.Type, where predicate: QueryPredicate? = nil, sort sortInput: QuerySortInput? = nil) -> AmplifyAsyncThrowingSequence<DataStoreQuerySnapshot<M>>