{"id":24589134,"url":"https://github.com/iomega8561/tools4swiftdata","last_synced_at":"2026-05-18T04:39:20.112Z","repository":{"id":270495612,"uuid":"910546253","full_name":"iOmega8561/Tools4SwiftData","owner":"iOmega8561","description":"A Swift 5.9 package that bundles amazing reusable utilities to deal with SwiftData in any scenario","archived":false,"fork":false,"pushed_at":"2025-07-11T17:29:53.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-13T03:42:04.065Z","etag":null,"topics":["apple","concurrency","ios","ipados","macos","swift","swiftdata","tvos","visionos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iOmega8561.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-31T15:35:26.000Z","updated_at":"2025-07-31T21:01:47.000Z","dependencies_parsed_at":"2025-03-17T22:00:34.602Z","dependency_job_id":"54b44663-6b41-4d33-baaa-a90ae16d7c8c","html_url":"https://github.com/iOmega8561/Tools4SwiftData","commit_stats":null,"previous_names":["iomega8561/tools4swiftdata"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iOmega8561/Tools4SwiftData","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iOmega8561%2FTools4SwiftData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iOmega8561%2FTools4SwiftData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iOmega8561%2FTools4SwiftData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iOmega8561%2FTools4SwiftData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iOmega8561","download_url":"https://codeload.github.com/iOmega8561/Tools4SwiftData/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iOmega8561%2FTools4SwiftData/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33165091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","concurrency","ios","ipados","macos","swift","swiftdata","tvos","visionos"],"created_at":"2025-01-24T08:13:54.602Z","updated_at":"2026-05-18T04:39:20.099Z","avatar_url":"https://github.com/iOmega8561.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tools4SwiftData\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://developer.apple.com/xcode/swiftdata\"\u003e\n    \u003cimg src=\"https://developer.apple.com/assets/elements/icons/swiftdata/swiftdata-96x96_2x.png\" width=\"150\" height=\"150\"\u003e\n  \u003c/a\u003e\n\n  [![Swift](https://img.shields.io/badge/Swift-5.9-orange.svg)](https://swift.org/download/)\n  \u003cp\u003eA comprehensive framework for streamlined data persistence, transfer, and management in Swift.\u003cbr\u003eTakes advantage of Swift's concurrency model and structured protocols for reliable data workflows.\u003c/p\u003e\n  \n\u003c/div\u003e\n\n---\n\n## Features\n\n**Tools4SwiftData** simplifies data operations in Swift with robust and flexible tools, including:\n\n### **Protocols**\n- **`SwiftDataTransferable`**: Represents a model suitable for data transfer, initialized from a persistent model.\n- **`SwiftDataPersistable`**: Defines a model capable of persisting data, ensuring all stored models are validated.\n- **`SwiftDataConfigurable`**: A configurable model interface with validation logic to guarantee correctness before use.\n\n### **Components**\n- **`SwiftDataProvider`**: A class providing shared access to the persistence container for data management.\n- **`SwiftDataManager`**: An actor designed for thread-safe CRUD operations on your data store, ensuring data integrity across contexts.\n\n### **Concurrency-Safe Design**\n- Strict adherence to Swift’s concurrency model using `Sendable` and `@ModelActor`.\n\n---\n\n## Installation\n\n### Swift Package Manager (SPM)\nAdd the package to your Xcode project:\n\n1. In Xcode, go to **File \u003e Add Packages**.\n2. Enter the URL for this repository:  \n   ```plaintext\n   https://github.com/iOmega8561/Tools4SwiftData.git\n   ```\n3. Choose the appropriate version rules and add the package.\n\n---\n\n## Usage\n\n### **SwiftDataTransferable**\nDefine a model suitable for data transfer:\n```swift\nstruct MyTransferableModel: SwiftDataTransferable {\n    typealias PersistableType = MyPersistableModel\n    let persistentModelID: PersistentIdentifier\n\n    init(_ persistentModel: MyPersistableModel) {\n        self.persistentModelID = persistentModel.persistentModelID\n    }\n}\n```\n\n### **SwiftDataPersistable**\nImplement a persistent model initialized from a validated configuration:\n```swift\nstruct MyPersistableModel: SwiftDataPersistable {\n    typealias ConfigurableType = MyConfigurableModel\n    static let filePrefix = \"MyModel\"\n\n    init(_ configurableModel: MyConfigurableModel) {\n        // Initialize from configuration\n    }\n}\n```\n\n### **SwiftDataProvider**\nCreate a shared persistence container:\n```swift\nlet dataProvider = try SwiftDataProvider\u003cMyTransferableModel\u003e(\n    writeDataStoreAt: FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!\n)\n```\n\n### **SwiftDataManager**\nPerform CRUD operations safely using `SwiftDataManager`:\n```swift\nlet dataManager = dataProvider.managerCreator()\n\n// Add an item\ntry await dataManager.addItem(configurableModel)\n\n// Fetch items\nlet items = try await dataManager.fetch()\n\n// Update an item\ntry await dataManager.updateItem(id: itemID) { item in\n    item.property = newValue\n}\n\n// Delete an item\ntry await dataManager.deleteItem(id: itemID)\n```\n\n---\n\n## Concurrency and Safety\n\nThis package is built with Swift’s strict concurrency rules in mind, ensuring data integrity and safe access across multiple threads. By leveraging actors, all data operations are thread-safe and efficient.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiomega8561%2Ftools4swiftdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiomega8561%2Ftools4swiftdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiomega8561%2Ftools4swiftdata/lists"}