Sign in

Brandon Williams

@mbrandonw.bsky.social
521 followers 141 following 25 posts

Subterranean homesick mathematician. Co-host of @pointfree.co. www.fewbutripe.com

PostsRepliesMedia
Reposted by Brandon Williams
Point-Free @pointfree.co · 27/05/2026
A brand new library from Point-Free! DebugSnaphots can instantly make your classes and @Observable models debuggable and testable. Simply apply the macro and get insight into how data changes over time, and write exhaustive tests on your feature's logic. www.pointfree.co/blog/posts/2...
pointfree.co
DebugSnapshots: Public beta
DebugSnapshots is now in public beta! After incubating in Point-Free Beta Previews, it is the first library to graduate to the public, bringing exhaustive testing and focused debugging tools to…
052
Brandon Williams @mbrandonw.bsky.social · 27/05/2026
You know that thing where classes are really hard to test because you can only assert on each field individually and not on the whole object at once? Well, what if I told you that we fixed that thing?
062
Brandon Williams @mbrandonw.bsky.social · 03/10/2025
This gives you the benefits of “single-table inheritance” for SQLite tables without the pain of actual class inheritance! 😂 It lets you fully use Swift's powerful domain modeling tools for you database, such as structs and enums.
081
Reposted by Brandon Williams
Point-Free @pointfree.co · 29/09/2025
Our most recent library, SQLiteData, embodies this principle. It pre-supposes: what if I don't want to massively refactor my codebase just because at some point I need to write a bit of code outside of a SwiftUI view 🤪 github.com/pointfreeco/...
github.com
GitHub - pointfreeco/sqlite-data: A fast, lightweight replacement for SwiftData, powered by SQL and supporting CloudKit synchronization.
A fast, lightweight replacement for SwiftData, powered by SQL and supporting CloudKit synchronization. - pointfreeco/sqlite-data
031
Reposted by Brandon Williams
Point-Free @pointfree.co · 29/09/2025
Tired of the “To MVVM or not to MVVM” discussions that plague our community? Us too 😅 That’s why we build tools that work in SwiftUI views, @‌Observable models, UIKit, AppKit, Linux, and more! You should build your app in the way that makes the most sense for you and your team.
192
Reposted by Brandon Williams
Point-Free @pointfree.co · 17/09/2025
It’s finally here: SQLiteData 1.0: a fast, lightweight replacement for SwiftData with full CloudKit support. www.pointfree.co/blog/posts/1...
pointfree.co
SQLiteData 1.0: An alternative to SwiftData with CloudKit sync and sharing
Announcing SQLiteData 1.0: A fast, lightweight alternative to SwiftData with full support for CloudKit synchronization and data sharing.
0286
Brandon Williams @mbrandonw.bsky.social · 05/08/2025
SwiftData offers a promise of simple persistence with easy synchronization. We feel it currently falls short of that goal, but in the fullness of time it may achieve it. But, for the present, we are working on tools that achieve SwiftData's promise, and honestly a lot more.
061
Reposted by Brandon Williams
Point-Free @pointfree.co · 17/06/2025
Next week: We are hosting a live stream where we will preview some fantastic new features coming to our SQLite persistence library, including CloudKit sync and sharing, and answer your questions! Submit your questions *today* 👇 www.pointfree.co/blog/posts/1...
pointfree.co
Upcoming live stream: A vision for modern persistence
We are hosting a live stream on June 25th to unveil our vision for modern persistence. Learn how to seamlessly synchronize your app’s data across many devices, including sharing data with other iCloud...
063
Reposted by Brandon Williams
Point-Free @pointfree.co · 22/05/2025
That's right. You can have the best of both worlds. You get unfettered access to SQLite, a fantastic technology that has stood the test of time, while behind the scenes every change is synchronized across devices using CloudKit. Seems almost too good to be true!
2173
Reposted by Brandon Williams
Point-Free @pointfree.co · 21/05/2025
We've had a major breakthrough in the most requested feature of our SwiftData alternative: SharingGRDB. More details coming soon... 👀
A partially obscured screenshot giving a sneak peek of how our SharingGRDB library will eventually work with CloudKit for cloud syncing.
1163
Reposted by Brandon Williams
Point-Free @pointfree.co · 19/05/2025
We finish the lists feature of our Apple's Reminders app rebuild. We introduce advanced queries including counts and custom data types. And we show how “drafts” allow us to create and update lists using the same view while keeping the domain as precise as possible. www.pointfree.co/episodes/ep3...
021
Reposted by Brandon Williams
Point-Free @pointfree.co · 22/04/2025
Announcing a toolkit that provides a SwiftData-like experience to SQLite: SharingGRDB with StructuredQueries. www.pointfree.co/blog/posts/1...
pointfree.co
A fast, lightweight replacement for SwiftData
Replace SwiftData with a fast, ergonomic and lightweight suite of tools powered by SQL. It provides APIs similar to @Model, @Query and #Predicate, but is tuned for direct access to the underlying data...
0105
Reposted by Brandon Williams
Point-Free @pointfree.co · 26/03/2025
Don't miss out on our exciting series that designs this SQL building library from scratch! We explore many advanced topics of Swift along the way, as well as a crash course in SQL and databases! www.pointfree.co/collections/...
pointfree.co
SQLite › SQL Building
SQL is one of the most powerful and concise programming languages ever invented, but it is usually written as a raw string in some other language, such as Swift, Javascript, Ruby, and so on. In this s...
121
Brandon Williams @mbrandonw.bsky.social · 26/03/2025
This query is traversing a recursive one-to-many relationship in SQL (Category belongs to parent Category) to print out the hierarchy of categories. Why do this work in application code when SQL can knock it out efficiently in just a few lines??
011
Reposted by Brandon Williams
Point-Free @pointfree.co · 24/03/2025
We add sorting to our SQL builder, which will give us a powerful, succinct syntax for controlling the order of results. We will start small but build up to parameter packs and even a custom result builder to get the most flexibility out of our API. www.pointfree.co/episodes/ep3...
041
Brandon Williams @mbrandonw.bsky.social · 20/03/2025
Even in a Swift query builder scares you, there is nothing stopping you from writing raw SQL with a static description of your database schema!
041
Reposted by Brandon Williams
Point-Free @pointfree.co · 19/03/2025
Some have expressed skepticism over using our upcoming query builder vs. writing raw SQL. Well our library lets you pick your poison! Both options are schema-safe and safe from SQL injection, but one is further type-safe and guaranteed to generate valid SQL:
A code snippet showing how the #sql macro can specify a query:

@SharedReader(
  .fetchAll(
    #sql(
      """
      SELECT count(\(Reminder.id)), \(RemindersList.columns)
      FROM \(RemindersList.self)
      JOIN \(Reminder.self) ON \(Reminder.remindersListID) = \(RemindersList.id)
      WHERE NOT \(Reminder.isCompleted)
      GROUP BY \(RemindersList.id)
      """,
      as: ReminderListState.self
    ),
    animation: .default
  )
)
private var remindersListsA code snippet showing a type-safe query builder:

@SharedReader(
  .fetchAll(
    RemindersList.group(by: \.id)
      .join(Reminder.incomplete) { $0.id.eq($1.remindersListID) }
      .select {
        ReminderListState.Columns(reminderCount: $1.count(), remindersList: $0)
      },
    animation: .default
  )
)
private var remindersLists
0111
Reposted by Brandon Williams
Point-Free @pointfree.co · 17/03/2025
We now have a type-safe syntax for generating SELECT statements using key paths, but we can do better. Let’s introduce a more advanced syntax that leverages variadic generics and supports more complex query expressions. www.pointfree.co/episodes/ep3...
042
Reposted by Brandon Williams
Point-Free @pointfree.co · 13/03/2025
While building our SQL building library we have created a state-of-the-art testing tool that allows us to simultaneously snapshot the SQL generated by the library, and the results fetched from the database.
041
Reposted by Brandon Williams
Point-Free @pointfree.co · 04/03/2025
Imagine a SQL building library for which it is easy to define query fragment helpers that can be pieced together in all kinds of interesting ways. That is exactly what we are building, and this week we give a sneak peek of the library: www.pointfree.co/episodes/ep3...
Screenshot of Xcode showing off the reusability aspects of our new query building library. The code reads as follows:

@Table
struct SyncUp {
  let id: Int
  var duration: Int
  var title: String
  static let withAttendeeCount = SyncUp
    .group(by: \.id)
    .join(Attendee.all()) { $0.id == $1.syncUpID }
    .select { ($0, $1.id.count()) }
}

@Table
struct Attendee {
  let id: Int
  var name: String
  var syncUpID: Int
  static let withSyncUp = join(SyncUp.all()) {
    $0.syncUpID == $1.id }
}

let blobAttendees = Attendee.withSyncUp
  .where { attendees, _ in
    attendees.name.collate(.nocase).like("%blob%")
  }

let morningSyncUps = SyncUp.withAttendeeCount
  .where { syncUps, _ in
    syncUps.title.collate(.nocase).like("%blob%")
  }
1152
Reposted by Brandon Williams
Point-Free @pointfree.co · 06/03/2025
A tricky part to domain modeling with SQLite is how to handle auto incrementing primary keys. You are forced to use optional IDs, but that leaks complexity throughout your app and complicates Identifiable conformances. Our @Table macro handily fixes this by generating a Draft type with no ID.
Screenshot of code showing how an optional ID is forced when dealing with auto incrementing primary keys in SQLite.

The code reads as follows:

struct Reminder: Identifiable {
  // 😒 Mutable, optional ID necessary since 
  //    SQLite determines the ID.
  var id: Int?
  var title: String
  var isCompleted = false
}


let reminder1 = Reminder(title: "Get groceries")
let reminder2 = Reminder(title: "Get haircut")

reminder1.id == reminder2.id  // ⚠️ Unexpected!A screenshot of code showing how our @Table macro fixes this problem by generating a dedicated Draft type that does not have an ID. That allows our model to have an immutable, non-optional ID.

The code reads as follows:

@Table
struct Reminder: Identifiable {
  // 😃 Can use immutable, non-optional ID because the 
  //    inner Draft type represents an unsaved record.
  let id: Int
  var title: String
  var isCompleted = false
}


let draft1 = Reminder.Draft(title: "Get groceries")
let draft2 = Reminder.Draft(title: "Get haircut")

try Reminder.insert(
  Reminder.Draft(title: "Get groceries")
)
.returning(\.self)

/*
 INSERT INTO "reminders"
 ("title") VALUES ('Get groceries')
 RETURNING "id", "title", "isCompleted"
*/
291
Reposted by Brandon Williams
Point-Free @pointfree.co · 05/03/2025
Swift 6.1 brings meta type key paths to the language, and that unlocks a new level of composability in our SQL building library. You can chain together multiple static helpers to build complex queries. Watch us do this live in this week's episode: 👉 www.pointfree.co/episodes/ep3...
Screenshot of code showing how to use Swift 6.1's meta type key paths to chain together static helpers. Code reads as follows:

@Table
struct SyncUp {
  var id: Int
  var isDeleted = false
  var duration: Int
  var title: String

  static let notDeleted = Self.where { !$0.isDeleted }
  static let shortDuration = Self.where { $0.duration <= 60 * 5 }
}

// 🤯 Swift 6.1 metatype key paths and dynamic member lookup
// make this possible even though 'notDeleted' and 'shortDuration'
// are both static properties:
let query = SyncUp
  .notDeleted
  .shortDuration

/*
SELECT
  "syncUps"."id",
  "syncUps"."duration",
  "syncUps"."isDeleted",
  "syncUps"."title" 
FROM "syncUps" 
WHERE 
  NOT "syncUps"."isDeleted"
  AND "syncUps"."duration" <= 300
*/
092
Brandon Williams @mbrandonw.bsky.social · 20/02/2025
This is an incredibly powerful library that simply would not have been possible to build in Swift from a year ago. We are very excited to dive deep into this in our next series of episodes!
0102
Reposted by Brandon Williams
Point-Free @pointfree.co · 19/02/2025
Watch us live code a complex query to fetch all reminders that are high priority, or flagged, or has the tag "#kids" associated with it. This requires a complex subquery that is not easily accomplishable in SwiftData. Get all the details here: www.pointfree.co/clips/105827...
pointfree.co
Powering state with a complex SQL query
Watch us live write a complex SQL query to load "really important reminders", and seamlessly integrate that state in our app. The database will automatically be observed for changes so that we can re-...
073
Reposted by Brandon Williams
Point-Free @pointfree.co · 17/02/2025
Our livestream is now up! • We discuss advanced uses of our Sharing library: Firebase and Wasm • We release a brand new library: SharingGRDB, an alternative to SwiftData • We preview a new library: StructuredQueries • And we answer dozens of viewer questions! 👉 www.pointfree.co/episodes/ep3...
051
Reposted by Brandon Williams
Point-Free @pointfree.co · 14/02/2025
In today's livestream we announced a brand new open source library: SharingGRDB. It's an alternative to SwiftData that gives you direct access to SQLite, works in UIKit, @​Observable models and SwiftUI views. Oh, and it back deploys to iOS 13 😲 www.pointfree.co/blog/posts/1...
pointfree.co
SharingGRDB: A SwiftData Alternative
We are excited to announce a new open source library that can serve as a SwiftData alternative for many types of apps out there today. It provides tools that work in SwiftUI views, @Observable models,...
0103
Reposted by Brandon Williams
Point-Free @pointfree.co · 14/02/2025
Reminder that we are going live in a few hours! We'll be discussing: 🤯 Advanced topics of our new Sharing library 🎉 Announcing a brand new open source library 👀 Sneak peek at our next episode series 🙋 Questions from our viewers www.pointfree.co/live
pointfree.co
🔴 Point-Free Live
Point-Free Live is a periodic livestream where we discuss topics from episodes, explore our open source libraries, and take questions from our viewers.
031
Reposted by Brandon Williams
Point-Free @pointfree.co · 05/02/2025
Our tools make it possible to execute multiple SQL queries in a single DB transaction, and then use that data directly in a SwiftUI view. This is more efficient and makes it possible to group related state together.
Screenshot of code showing how to group multiple SQL statements in a single transaction and power a SwiftUI view with that state.

The code reads as follows:

struct FactsView: View {
  @SharedReader(.fetch(Facts(ordering: .savedAt))) var facts = Facts.Value()

  var body: some View {
    List {
      Section {
        Text("Unarchived facts: \(facts.unarchivedFactsCount)")
        Text("Archived facts: \(facts.archivedFactsCount)")
      }
      ForEach(facts.favoriteFacts) { fact in
        Text(fact.value)
      }
    }
  }
}

struct Facts: FetchKeyRequest {
  struct State {
    var archivedFactsCount = 0
    var favoriteFacts: [Fact] = []
    var unarchivedFactsCount = 0
  }

  let ordering: Ordering

  func fetch(_ db: Database) throws -> State {
    let archived = Fact.filter(Column("isArchived"))
    let unarchived = Fact.filter(!Column("isArchived"))
    return try State(
      archivedFactsCount: archived.fetchCount(db),
      favoriteFacts: unarchived.order(ordering.orderingTerm).fetchAll(db),
      unarchivedFactsCount: unarchived.fetchCount(db)
    )
  }
}
191
Reposted by Brandon Williams
Point-Free @pointfree.co · 04/02/2025
This week we finished an amazing series showing how to build a SwiftData alternative using simple SQLite. And the best part? All of these tools work going all the way back to iOS 13! 🤯 👉 www.pointfree.co/collections/...
Screenshot of our website showing all of the episodes in our Sharing with SQLite series.

The text on the page reads as follows:

Sharing with SQLite
Section • 4 episodes • 2 hr 38 min
Our Swift Sharing library allows one to hold onto state in feature code that is secretly powered by an external storage system, such as user defaults and the file system. But it is also flexible enough to be powered by SQLite too, and when done properly a lot of amazing powers are unlocked.

Core lessons

Sharing with SQLite: The Problems
45 min

Sharing with SQLite: The Solution
45 min

Sharing with SQLite: Advanced Queries
27 min

Sharing with SQLite: Dynamic Queries
39 min
093
Reposted by Brandon Williams
Point-Free @pointfree.co · 03/02/2025
We now have several features using SQLite via a simple property wrapper that offers the same ergonomics as SwiftData’s @‌Query macro, and it automatically keeps the view in sync with the database. Let's now see how to handle dynamic queries! 👉 www.pointfree.co/episodes/ep3...
041
Reposted by Brandon Williams
Point-Free @pointfree.co · 31/01/2025
Mark your calendars! Point-Free is hosting a live stream on Feb 14, 9am PST / 5pm GMT. We'll discuss our Sharing library as a modern persistence toolkit, a sneak peek at a new library we are working on, and we will take questions from our viewers! The Q&A is already open: www.pointfree.co/live
pointfree.co
🔴 Point-Free Live
Point-Free Live is a periodic livestream where we discuss topics from episodes, explore our open source libraries, and take questions from our viewers.
061
Reposted by Brandon Williams
Point-Free @pointfree.co · 29/01/2025
7 years ago today we launched Point-Free! What have been some of your favorite episodes, open source libraries, or moments since we launched? www.pointfree.co/blog/posts/1...
Screenshot of a part of our blog post that reads:

Point-Free turns 7! 🥳
Wednesday January 29, 2025
It’s hard to believe, but we launched Point-Free 7 years ago today! In that time we have released dozens of open source projects that collectively are cloned hundreds of thousands of times a week, responded to thousands of comments and discussions, and explored a wide breadth of topics. Everything from mathematical topics (algebraic data types, existentials, foundations of equality) to practical, real world topics (SQLite, parsers, architecture, cross-platform Swift), and everything in between.
9163
Reposted by Brandon Williams
Point-Free @pointfree.co · 29/01/2025
Learn about these advanced techniques in this week's episode: www.pointfree.co/episodes/ep3...
pointfree.co
Episode #311: Sharing with SQLite: Advanced Queries
Let’s leverage our new @Shared SQLite strategy by adding a brand new feature: archiving. We will see how easy it is to incorporate queries directly into a SwiftUI view, and we will expand our tools to...
021
Brandon Williams @mbrandonw.bsky.social · 29/01/2025
SQL is a powerful language and it's a bummer to put any abstraction over it that prevents access to all of its features. We are building tools that allow you to embrace a bit of abstraction where needed, but you always have access to all of SQL.
052
Reposted by Brandon Williams
Point-Free @pointfree.co · 21/01/2025
With just a bit of work you can switch from using JSON to persist your app's state to using a powerful SQLite database. Queries will define how your feature's access state, and they will automatically update if the database changes. 👉 www.pointfree.co/episodes/ep3...
A screenshot of code showing how to use the tools of Swift Sharing library to power a feature's state from a SQLite query. The code reads as follows:

@Observable
@MainActor
class FactFeatureModel {
  //@Shared(.fileStorage(.factsURL)))
  //var favoriteFacts: [Fact] = []

  @SharedReader(.fetchAll("SELECT * FROM facts"))
  var favoriteFacts: [Fact] = []

  // ...
}
031
Brandon Williams @mbrandonw.bsky.social · 20/01/2025
Some say that trying to use Swift Data outside of a view (such as an @Observable model) is "fighting the framework". But the fact that @Query does not work outside of views is only a limitation of Swift Data, and an unneeded one. We build a tool similar to @Query, but it can be used anywhere!
0122
Brandon Williams @mbrandonw.bsky.social · 13/01/2025
By the end of this series we will have built a suite of tools that provide a lot of the functionality of Swift Data, except the tools can be used anywhere (@Observable models, UIKit, SwiftUI, ...) and are cross-platform (Windows, Wasm, ...). It will be incredible to see!
191
Reposted by Brandon Williams
Point-Free @pointfree.co · 07/01/2025
📢 Announcing: Swift Sharing 2 The latest release of our popular open source library includes better support for Swift concurrency and error handling! www.pointfree.co/blog/posts/1...
A screen shot of the blog post linked to.
1223
Reposted by Brandon Williams
Point-Free @pointfree.co · 06/01/2025
No new episode this week as we prepare for our next series (it's a doozy!), but we are excited to announce that our 4-part series “Tour of Sharing” is free for all to watch. Learn the basics of our new Swift Sharing library today! www.pointfree.co/blog/posts/1...
pointfree.co
Tour of Sharing: Free for all to watch!
We are making the 4-part series “Tour of Sharing” free for everyone to watch!
041
Reposted by Brandon Williams
Point-Free @pointfree.co · 27/12/2024
We’re ending the year with one last sale: 🎁 25% off your first year! Unlock access to hundreds of episodes on advanced Swift topics, as well as everything we have planned for next year. Don’t miss this chance to level up your skills! www.pointfree.co/blog/posts/1...
pointfree.co
End-of-year sale: 25% off Point-Free
Through the new year, we’re offering personal Point-Free subscriptions for 25% off the first year!
043
Reposted by Brandon Williams
Point-Free @pointfree.co · 23/12/2024
We’re running a 25% discount through the end of the year! Don’t miss out on everything we have planned for 2025. There have been rumors that we are working on tools that might replace your need for Swift Data and are cross-platform 😲. 🎁 www.pointfree.co/discounts/eo... 🎁
174
Reposted by Brandon Williams
Point-Free @pointfree.co · 20/12/2024
We released 4 brand new open source projects this year, 2 of which were first incubated inside the Composable Architecture and then later extracted. Find out more of what we accomplished in our 2024 Year-in-review: www.pointfree.co/blog/posts/1...
072
Reposted by Brandon Williams
Point-Free @pointfree.co · 19/12/2024
This is an overview of the topics we covered in 2024, and if we only covered half of these it would still have been a great year. @Observable, lightweight state sharing and persistence tools, UIKit, cross-platform Swift, Equatable/Hashable, SQLite, and more! www.pointfree.co/blog/posts/1...
A screenshot of our blog post showing what topics we covered this year:

Point-Free Live: Observation in Practice
Sharing and Persisting State in the Composable Architecture
Modern UIKit
Cross-platform Swift
Back to basics: Equatable and Hashable
SQLite
Tour of Sharing
053
Reposted by Brandon Williams
Point-Free @pointfree.co · 19/12/2024
To celebrate the holiday season and all we’ve done this year, we’re also offering new subscribers a gift: 🎁 25% off your first year of Point-Free: www.pointfree.co/discounts/eo...
pointfree.co
Subscribe to Point-Free
Point-Free is a video series exploring advanced programming topics in Swift.
032
Reposted by Brandon Williams
Point-Free @pointfree.co · 17/12/2024
You can also persist state to the file system with our @Shared property wrapper. Here we have an array of strings in a model such that any changes to it are saved to disk, and any changes on disk are synchronized to the state. Learn more in our Tour of Sharing: www.pointfree.co/episodes/ep3...
Screenshot of code showing how to use the file storage persistence strategy with the @Shared property wrapper:

@Observable 
class FactFeatureModel {
  // Persist count to UserDefaults:
  @ObservationIgnored
  @Shared(.appStorage("count")) var count = 0

  // Persist favorite facts to the file system:
  @ObservationIgnored
  @Shared(.fileStorage(url)) var facts: [String] = []
}
031
Reposted by Brandon Williams
Point-Free @pointfree.co · 12/12/2024
SwiftUI’s @‍AppStorage property wrapper is wonderful, but it’s only meant to be used in SwiftUI views. The @‍Shared property wrapper, however, can be used anywhere: views, models, view controllers…your imagination is the limit! See it all work in this week’s episode: www.pointfree.co/episodes/ep3...
A code snippet showing the @Shared property wrapper in a SwiftUI view, @Observable model, and UIKit view controller.
0163
Reposted by Brandon Williams
Point-Free @pointfree.co · 09/12/2024
@Shared, unlike @AppStorage, can be used anywhere, not just SwiftUI views! And it has some extra bells and whistles that make it easier to write maintainable Xcode previews and avoid potential bugs around “string-ly” typed keys and default values. Learn how: www.pointfree.co/episodes/ep3...
181
Brandon Williams @mbrandonw.bsky.social · 09/12/2024
I may have misunderstood your original comment. When you say you want non-observable references in the environment, you are opening yourself up to this problem: gist.github.com/mbrandonw/ec... Changes to the class do not cause the view to update, and it's because the class is not observable.
220
Reposted by Brandon Williams
Point-Free @pointfree.co · 04/12/2024
We also have a demo of how to use '@Shared' with SQLite via GRDB. You can hold onto state in your features that is secretly backed by a SQL query, and changes to the database will automatically update the view: github.com/pointfreeco/...
131
Reposted by Brandon Williams
Point-Free @pointfree.co · 03/12/2024
Today's the last day to take advantage of our Cyber Monday sale! Get 30% off the next year of your Point-Free subscription, and explore advanced topics in Swift and SwiftUI with us! www.pointfree.co/blog/posts/1...
pointfree.co
Cyber Monday: Last Chance to Save
Our holiday sale is ending soon! Subscribe today at a 30% discount and get instant access to hundreds of hours of advanced Swift content exploring everything from modern concurrency to generics to dom...
031