{"id":1019,"url":"https://github.com/objectbox/objectbox-swift","last_synced_at":"2026-01-27T23:34:15.701Z","repository":{"id":40685817,"uuid":"157887171","full_name":"objectbox/objectbox-swift","owner":"objectbox","description":"Swift database - fast, simple and lightweight (iOS, macOS)","archived":false,"fork":false,"pushed_at":"2024-02-14T11:27:05.000Z","size":1124,"stargazers_count":416,"open_issues_count":20,"forks_count":31,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-03-15T12:08:35.488Z","etag":null,"topics":["database","edge","embedded","ios","local","mobile","nosql","offline-first","storage","sustainable","swift","sync"],"latest_commit_sha":null,"homepage":"https://swift.objectbox.io","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/objectbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2018-11-16T15:38:24.000Z","updated_at":"2024-04-21T17:51:13.739Z","dependencies_parsed_at":"2024-04-21T18:11:38.798Z","dependency_job_id":null,"html_url":"https://github.com/objectbox/objectbox-swift","commit_stats":{"total_commits":211,"total_committers":7,"mean_commits":"30.142857142857142","dds":0.6208530805687205,"last_synced_commit":"3c96b8d8f35bb88442b3dcd2a01892b1e69e019b"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fobjectbox-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fobjectbox-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fobjectbox-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fobjectbox-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/objectbox","download_url":"https://codeload.github.com/objectbox/objectbox-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312081,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","edge","embedded","ios","local","mobile","nosql","offline-first","storage","sustainable","swift","sync"],"created_at":"2024-01-05T20:15:37.170Z","updated_at":"2026-01-27T23:34:15.677Z","avatar_url":"https://github.com/objectbox.png","language":"Swift","funding_links":[],"categories":["Database","Swift"],"sub_categories":["Getting Started","Linter"],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg width=\"466\" src=\"https://raw.githubusercontent.com/objectbox/objectbox-swift/master/images/logo.png\" alt=\"ObjectBox\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://swift.objectbox.io/getting-started\"\u003eGetting Started\u003c/a\u003e •\n  \u003ca href=\"https://swift.objectbox.io\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"https://github.com/objectbox/objectbox-swift/tree/main/Example\"\u003eExample Apps\u003c/a\u003e •\n  \u003ca href=\"https://github.com/objectbox/objectbox-swift/issues\"\u003eIssues\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#add-objectbox-to-your-project\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/tag/objectbox/objectbox-swift-spm?label=Swift%20Package\" alt=\"Add Swift Package\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#add-objectbox-to-your-project\"\u003e\n    \u003cimg src=\"https://img.shields.io/cocoapods/v/ObjectBox.svg\" alt=\"Add pod\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# ObjectBox Swift Database - swiftly persist objects \u0026 vector embeddings on iOS \u0026 macOS\n\nPowerful \u0026 superfast on-device vector database for Swift that's also easy to use. Persist Swift objects quickly and reliably locally on\niOS and macOS for seamless offline-first apps. With fast local vector search for powerful Edge AI features - local, private, speedy. \n\n## Demo code\n\n```swift\n// objectbox: entity\nclass Person {\n    var id: Id = 0\n    var firstName: String = \"\"\n    var lastName: String = \"\"\n    \n    init() {}\n    \n    init(id: Id = 0, firstName: String, lastName: String) {\n        self.id = id\n        self.firstName = firstName\n        self.lastName = lastName\n    }\n}\n\nlet store = try Store(directoryPath: \"person-db\")\nlet box = store.box(for: Person.self)\n\nvar person = Person(firstName: \"Joe\", lastName: \"Green\")\nlet id = try box.put(person) // Create\n\nperson = try box.get(id)!    // Read\n\nperson.lastName = \"Black\"\ntry box.put(person)          // Update\n\ntry box.remove(person.id)    // Delete\n\nlet query = try box.query {  // Query\n    Person.firstName == \"Joe\"\n    \u0026\u0026 Person.lastName.startsWith(\"B\")\n}.build()\nlet people: [Person] = try query.find()\n```\n\nWant details? **[Read the guide](https://swift.objectbox.io/)** or\n**[check out the API reference](https://objectbox.io/docfiles/swift/current/)**.\n\n## Why use ObjectBox for Swift data persistence?\n\nSimple but powerful; frugal but fast: The ObjectBox NoSQL database offers an intuitive Swift API that's easy to pick up,\nfun to work with, and incredibly fast, making it sustainable in many ways. Its frugal recource use (CPU, memory, \nbattery / power) makes ObjectBox an ideal and sustainable choice for iOS apps. So why not give it a try right away? \nCheck out the [installation section below](#add-objectbox-to-your-project). You can also star this repository for later 🌟\n\n### Features\n\n🧠 **Artificial Intelligence** - superfast [on-device vector search](https://docs.objectbox.io/on-device-ann-vector-search).\\\n🏁 **High performance** on restricted devices, like IoT gateways, micro controllers, ECUs etc.\\\n💚 **Resourceful** with minimal CPU, power and Memory usage for maximum flexibility and sustainability\\\n🔗 **Relations:** object links / relationships are built-in\\\n💻 **Multiplatform:** Linux, Windows, Android, iOS, macOS\n\n🌱 **Scalable:** handling millions of objects resource-efficiently with ease\\\n💐 **Queries:** filter data as needed, even across relations\\\n🦮 **Statically typed:** compile time checks \u0026 optimizations\\\n📃 **Automatic schema migrations:** no update scripts needed\n\n**And much more than just data persistence**\\\n👥 **[ObjectBox Sync](https://objectbox.io/sync/):** keeps data in sync between devices and servers\\\n🕒 **[ObjectBox TS](https://objectbox.io/time-series-database/):** time series extension for time based data\n\n## Add ObjectBox to your project\n\nObjectBox is available as a\n\n- [Swift Package](#swift-package)\n- [CocoaPods](#cocoapods) pod\n\n### Swift Package\n\nInstructions depend on whether you want to set up an Xcode project (to build iOS and macOS apps) or a Swift Package Manager manifest.\n\n#### Set up an Xcode project\n\nIn Xcode, [add a package dependency](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app) \nand search for the package URL:\n\n```\nhttps://github.com/objectbox/objectbox-swift-spm\n```\n\nFor the Dependency Rule, we recommend to use \"Up to Next Major Version\". To find the latest \nversion to use view the [tags of the objectbox-swift-spm repository](https://github.com/objectbox/objectbox-swift-spm/tags).\n\nFinally, when asked, add the `ObjectBox.xcframework` to your app target. Or to use \n[ObjectBox Sync](https://objectbox.io/sync/) (requires access to the Sync feature), add the `ObjectBox-Sync.xcframework` \ninstead.\n\nNow, you are all set to define your first ObjectBox entities! To continue check the \n[Getting Started guide](https://swift.objectbox.io/getting-started) or [the example project](#example).\n\n#### Set up a Swift Package Manager manifest\n\nIn your `Swift.package` file, add the ObjectBox Swift Package repository to the `dependencies` block:\n\n```swift\n.package(url: \"https://github.com/objectbox/objectbox-swift-spm.git\", from: \"5.1.0\"),\n```\n\nAdd the `ObjectBox.xcframework` to the `dependencies` of the desired target in `targets`:\n\n```swift\n.product(name: \"ObjectBox.xcframework\", package: \"objectbox-swift-spm\")\n```\n\nOr to use [ObjectBox Sync](https://objectbox.io/sync/) (requires access to the Sync feature), add the \n`ObjectBox-Sync.xcframework` instead:\n\n```swift\n.product(name: \"ObjectBox-Sync.xcframework\", package: \"objectbox-swift-spm\")\n```\n\nYour `Swift.package` file should then contain sections similar to this:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/objectbox/objectbox-swift-spm.git\", from: \"\u003cversion\u003e\"),\n],\ntargets: [\n  .executableTarget(\n    name: \"YourApp\",\n    dependencies: [\n        .product(name: \"ObjectBox.xcframework\", package: \"objectbox-swift-spm\")\n    ],\n]\n```\n\nNow, you are all set to define your first ObjectBox entities! To continue check the \n[Getting Started guide](https://swift.objectbox.io/getting-started) or [the example project](#example).\n\n### CocoaPods\n\nIf you are new to CocoaPods, [check out their website](https://cocoapods.org) for an introduction and installation \ninstructions.\n\nTo add the ObjectBox Swift dependency, add the following line to your `Podfile`:\n\n```\npod 'ObjectBox'\n```\n\nThen install the pod and run the ObjectBox setup script:\n\n```bash\npod install --repo-update\nPods/ObjectBox/setup.rb\n```\n\nThe `setup.rb` script will configure your Xcode project to run ObjectBox generator on every build by adding a build \nphase (called \"[OBX] Update Sourcery Generated Files\") for every target with an executable.\n\n**Disable the User Script Sandboxing** option in your Xcode project build settings to allow the ObjectBox generator \nscript to run.\n\n\u003e [!NOTE]\n\u003e The ObjectBox code generator needs to run in the project directory and will generate files there. If this is executed\n\u003e in a sandbox, the build phase will fail.\n\nThen, open your Xcode workspace (.xcworkspace) instead of the Xcode project (.xcodeproj).\n\nNow, you are all set to define your first ObjectBox entities! To continue check the \n[Getting Started guide](https://swift.objectbox.io/getting-started) or [the example project](#example).\n\n#### Troubleshoot setup issues\n\nIf installing the pod or configuring the project failed, try to update the xcodeproj and cocoapods gem:\n\n```bash\ngem update xcodeproj \u0026\u0026 gem update cocoapods \u0026\u0026 pod repo update\n```\n\n\u003e [!NOTE]\n\u003e On Apple Silicon (M1), ensure you have the latest gems for CocoaPods:\n\u003e \n\u003e `gem update ffi ethon`\n\n#### Update to a new version\n\nAfter a new version of ObjectBox Swift is released, update the ObjectBox pod and run the setup script again:\n\n```bash\npod repo update\npod update ObjectBox\nPods/ObjectBox/setup.rb\n```\n\n### Recommended Xcode project settings\n\nObjectBox Swift does not include Bitcode, so you may need to adjust \"Build Settings\" in Xcode accordingly. In that tab, \nensure \"All\" is active and search for \"bitcode\". You will find the \"Enable Bitcode\" setting which you set to \"No\".\n\nOtherwise, for some build targets, you will get a build error like this:\n\n```\n'.../ObjectBox.framework/ObjectBox' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting \nENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.\n```\n\n## Example\n\nIn the [Example](Example) directory, you'll find a \"Notes\" example app demonstrating ObjectBox's Swift API.\nThe example comes with two apps: one for iOS and one for macOS. The iOS example is a full GUI application, whereas the \nmacOS example runs a few operations and then exits.\n\n## Changelog\n\nFor notable and important changes in new releases, read the [changelog](CHANGELOG.md).\n\n## Development\n\nThe source code for ObjectBox's Swift binding can be found [in the Source folder](Source/README.md) of this repository.\n\n## Background: code generation\n\nObjectBox Swift Database uses generated code for optimal performance at runtime by avoiding reflection etc.\n\nIt uses [a fork of Sourcery](https://github.com/objectbox/objectbox-swift-generator) for this.\n\n## Already using ObjectBox?\n\nWe're on a mission to bring joy, delight and sustainability to app developers. **To do this, we need your help:** Please\nfill in this 2-minute [Anonymous Feedback Form](https://forms.gle/LvVjN6jfFHuivxZX6). Let us know what you love and what is amiss, so we can improve.\n\n**We're looking forward to receiving your comments and requests:**\n\n- Add [GitHub issues](https://github.com/ObjectBox/objectbox-swift/issues)\n- Upvote issues you find important by hitting the 👍 reaction button\n- Drop us a line via contact📧objectbox.io\n- ⭐ this repository, if you like what you see\n\nThank you! 🙏\n\nKeep in touch: For general news on ObjectBox, [check our blog](https://objectbox.io/blog)!\n\n## Cross-platform database: Mobile, Desktop, Browser, Embedded, IoT\n\nObjectBox is a cross-platform database supporting sustainable app development in [multiple native languages](https://objectbox.io/dev-get-started/):\n\n- [ObjectBox C and C++ SDK](https://github.com/objectbox/objectbox-c): native speed with zero copy access to objects on embedded devices\n- [ObjectBox Java and Kotlin SDK](https://github.com/objectbox/objectbox-java): runs on Android, desktop, and servers.\n- [ObjectBox Dart and Flutter SDK](https://github.com/objectbox/objectbox-dart): persist Dart objects \u0026 build cross-platform apps using Flutter.\n- [ObjectBox Go SDK](https://github.com/objectbox/objectbox-go): great for IoT, data-driven tools, and server applications.\n  also enables porting ObjectBox to other languages.\n\n## License\n\n```text\nCopyright 2018-2025 ObjectBox Ltd. All rights reserved. \u003chttps://objectbox.io\u003e\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nNote that this license applies to the code in this repository only.\nSee our website on details about all [licenses for ObjectBox components](https://objectbox.io/faq/#license-pricing).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectbox%2Fobjectbox-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectbox%2Fobjectbox-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectbox%2Fobjectbox-swift/lists"}