WWDC WEEK
SALE
30
%
off
Subscribe now
WWDC WEEK
SALE
30
%
off
Subscribe now

Modern Persistence: Reminders Detail, Part 2

Episode #327 • Jun 2, 2025 • Subscriber-Only

How does our SQL-based solution for persistence compare with modern SwiftData? We put things to the test by rebuilding our complex @FetchAll query using @Model and the @Query macro!

Previous episode
Modern Persistence: Reminders Detail, Part 2
Locked

Unlock This Episode

Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.

Sign in with GitHub

Introduction

Stephen

This one query handles selecting only the incomplete reminders if needed, as well as selecting only reminders belonging to a particular list. It orders those reminders so that the incomplete are up top, and then further orders them by either their due date, priority or title. Sure, it’s a mouthful of a query, but it can also be expressed as one single expression and does not need to be split up into a bunch of different pieces for no reason.

It’s just really incredible to see how easy it is to build a complex query with our libraries. And each step of the way we get static access to the schema of our tables that helps prevent typos, type-mismatches, or just constructing non-sensical queries.

Brandon

However, to really drive home how incredible we think this is, we want to pause our journey towards recreating Apple’s reminders app to take a moment and reflect. We personally think that these tools provide a great alternative to SwiftData. They accomplish most of what SwiftData accomplishes, and the code written often looks very similar to SwiftData, but our tools give us full, unfettered access to the power of SQL, which we are really starting to take advantage of now.

So, let’s take a moment to dabble in some SwiftData. Let’s see what it looks like if we were to try to rebuild this complex query using the tools that SwiftData gives us. I think our viewers are going to be pretty surprised by what we uncover here.

@FetchAll vs. @Query


References

Downloads

Get started with our free plan

Our free plan includes 1 subscriber-only episode of your choice, access to 71 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing