When all you have is a Core Data, everything looks like…

Still from the scene in Orgazmo with the Mormon Missionaries greeting a homeowner at their door and asking "Have you heard the good news about Core Data?".

Reading SwiftData vs Realm: Performance Comparison reminded me of an anecdote from my days working on Shark, at Apple. I don’t really remember the timing – sometime between 2006 and 2010 – but presumably around 2006 as I recall it was when Core Data was still relatively new. For whatever reason, there was a huge… Read more

SwiftData pitfalls

I’ve been exploring SwiftData lately, and I’ve been unpleasantly surprised by how many sharp edges it has. I’m going to try to describe some of them here, so that hopefully others can avoid them (or perhaps be dissuaded from using SwiftData to begin with). I’m using Xcode 15.0.1 (Swift 5.9) on macOS 14.1 (Sonoma). Background… Read more

SQLite table constraints must be specified after all columns

Marking this one for future reference. TL;DR:  You have to specify all the columns in your table, in a CREATE TABLE statement, before you specify table constraints like primary or foreign keys. SQLite gives the most useless error messages most of the time.  Case in point: CREATE TABLE “Foo” ( “ColumnA” TEXT NOT NULL UNIQUE, “ColumnB”… Read more