How do I delete all the rows in an entity and/or delete the entity all together in SwiftData?
Here is a function I used to delete an entity in core data for reference.
class func deleteEntity(entity: String) {
let fetchRequest1: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest(entityName: entity)//entity.fetchRequest()
let batchDeleteRequest1 = NSBatchDeleteRequest(fetchRequest: fetchRequest1)
_ = try? PersistanceController.shared.container.viewContext.execute(batchDeleteRequest1)
print("Deleting coredata entity: \(entity)")
}