CoreStore
GRDB.swift
Our great sponsors
CoreStore | GRDB.swift | |
---|---|---|
11 | 37 | |
3,932 | 6,461 | |
- | - | |
5.3 | 9.3 | |
about 2 months ago | 5 days ago | |
Swift | Swift | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
CoreStore
-
Core data example
It’s not from Apple, but there’s a framework called CoreStore which you might find easier to pick up initially.
-
How to manage instances of a class
Core Data (and CoreStore, which is backed by Core Data) is an object persistence system (so objects can survive between application sessions), which lets you work with the objects in a more database-like way. For example, you can ask for all the instances of a Person object which match a predicate like the pets relationship is not nil. You can think of it like a more advanced version of arrays and sets.
-
Details View using CoreData
If you’re just starting out with Core Data, you may want to take a look at CoreStore. It’s an external dependency, but it does feel much more at home in Swift. Less of the constant optional unwrapping, for one.
-
Finally acquainting myself with CoreData after 10 years of mostly avoiding it. Very heavy obj-c baggage. Anyone recommend a wrapper?
CoreStore (though iCloud support is still in the works)
-
Items appended in an array are not remembered after restart.
More complicated than that is Core Data. It’s extremely powerful, but pretty weird to use at first. Doesn’t feel very Swift-y (Check out CoreStore for a more Swift feel). This is great for hundreds or thousands of objects. You can retrieve objects which match a particular search predicate, objects can have relationships to one another (e.g, a manager object can have an employees relationship to multiple employee objects), which you can traverse a lot like normal objects-which-contain-objects. This is massive overkill for storing strings, but great for something like a Twitter or Reddit client.
-
CoreData: the burden of the past
All the issues in the article had been solved by CoreStore since Swift’s inception. Check it out
- Store data and update it
-
Swift Playgrounds iPad - Core Data?
CoreStore works really well for pure Swift models: https://github.com/JohnEstropia/CoreStore/blob/develop/Playground_iOS.playground/Contents.swift
-
Realm vs CoreData in 2021. Which do you use and why?
CoreData through CoreStore. Full disclosure: I’m the author of the lib
-
Do you feel that NSFetchedResultsController doesn't fit well with diffable data source?
Source: I am the author of the CoreStore library. The faulting behavior of NSManagedObjects are what makes them incompatible with redux-type architecture (ex: SwiftUI) which is why CoreStore exposes an ObjectSnapshot as a struct wrapper layer for live objects.
GRDB.swift
-
Bundling database with iOS app
I'm using GRDB , you can use existing pre-populated sqlite DB file. https://github.com/groue/GRDB.swift/wiki/Performance .
-
How can I quickly parse a huge 45MB JSON file using JsonDecoder
Not quite exactly sure what you mean but if its a .sqlite3 file then you can use it with this easy to use library https://github.com/groue/GRDB.swift
-
Question about Apple's review
The 3rd party library I use GRDB SwiftyUserDefaults Kingfisher SwiftDate Popovers
-
When considering how to store data for something like a cooking recipe application, what are the disadvantages of using CoreData, when compared with other database options?
The other thing is that it could be an overkill for your app if you just need to basically "store an array of 100 objects". Then you could probably consider other solutions like SQLite (with wrappers like GRDB) or plain JSON files.
-
The most amazing project documentation you saw
https://github.com/groue/GRDB.swift#readme https://github.com/groue/GRDB.swift/tree/master/Documentation https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/
-
Struggles with Logic & CoreData
https://github.com/groue/GRDB.swift/blob/master/Documentation/AssociationsBasics.md might be interesting to look at for how it handles relationships between entities.
-
Database/permanent data storing solution for iOS
I recently used GRDB.
- GRDB-ORM, an ORM for GRDB - Swift SQLite
-
How to decide between JSON and CoreData?
Check the performance comparison page. GRDB comes with a convenient and ready-made support for Swift Codable that performs quite well. When needed, it is possible to write less convenient but optimized record types that add very little overhead to SQLite, and perform really well.
-
Is this an acceptable authentication/account management setup?
Hey all. So I just got done developing an app that does visitation tracking. Basically the user creates an account with email, name, password etc.. the info is then saved to a SQLite database (using GRDB) with a table named "User" and then injected into the next view controller and so on... I plan on allowing the user to store their account in icloud in the future.
What are some alternatives?
encrypted-core-data - v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
SQLite.swift - A type-safe, Swift-language layer over SQLite3.
Realm - Realm is a mobile database: a replacement for Core Data & SQLite
QueryKit - A simple CoreData query language for Swift and Objective-C.
FMDB - A Cocoa / Objective-C wrapper around SQLite
MagicalRecord - Super Awesome Easy Fetching for Core Data!
SwiftData
AlecrimCoreData
swift-composable-architecture - A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
Cadmium - A Swift framework that wraps CoreData, hides context complexity, and helps facilitate best practices.
IceCream - Sync Realm Database with CloudKit