Remix.run Logo
wahnfrieden 3 days ago

How else will you support CloudKit with SQLite? Personally CloudKit is a requirement as my customers value having their personal data inside their own Apple account rather than storing it on my servers. I also rely on CloudKit to avoid the cost and on-call burden of operating a realtime sync service.

Re: ORM, the SwiftData-like ORM part of SQLiteData is actually completely optional. You can write SQL statements directly via #sql: https://swiftpackageindex.com/pointfreeco/swift-structured-q... You can wrap usage of this in your own method so that you can swap out SQLiteData in the future without lock-in.

Re: Swift types, you may roll your own mapping, but performance is not trivial. Here is a benchmark from SQLiteData:

Orders.fetchAll setup rampup duration

   SQLite (generated by Enlighter 1.4.10) 0        0.144    7.183

   Lighter (1.4.10)                       0        0.164    8.059

   SQLiteData (1.0.0)                     0        0.172    8.511

   GRDB (7.4.1, manual decoding)          0        0.376    18.819

   SQLite.swift (0.15.3, manual decoding) 0        0.564    27.994

   SQLite.swift (0.15.3, Codable)         0        0.863    43.261

   GRDB (7.4.1, Codable)                  0.002    1.07     53.326
I found Enlighter and Lighter more intrusive to adopt, and the other open source solutions far slower (too slow for my needs, where my users have hundreds of thousands or millions of rows within the iOS apps)