I was curious as to what the underlying data format for SwiftData was …
Apparently, I missed this during the keynote (or I did hear it but didn’t pay enough attention) but it appears that SwiftData uses Core Data (or something pretty similar to Core Data) under the hood.
The screenshot shows the DB used by a sample SwiftData app and the file is simply an SQLite DB. And on a cursory inspection, the data structures look pretty similar to how Core Data stores data 🙂
Of course, I don’t use Core Data much, so I can’t be absolutely sure, but I do have to wonder how it would work if you had a Core Data-based app and simply wanted to switch over to SwiftData? Is there a way to use the existing data without any migration at all?
Interesting to consider …
At least one thing I know of for sure is that there’s an easy way to view/modify SwiftData persisted data since the underlying database is SQLite 🙂
#Apple #WWDC2023 #SwiftData #DataPersistenceScreenshot of an SQLite databas…