A Todo List app demonstrating the use of the PowerSync Swift SDK with GRDB and Supabase.
To run this demo, you need Supabase and PowerSync projects. Detailed instructions for integrating PowerSync with Supabase can be found in the integration guide.
Follow this guide to:
- Create and configure a Supabase project.
- Create a new PowerSync instance, connecting to the database of the Supabase project. See instructions here.
- Deploy sync rules.
-
Open
GRDBDemo.xcodeprojin XCode. -
Copy the
Secrets.template.swiftfile to a newSecrets.swiftfile and insert the credentials of your Supabase and PowerSync projects (more info can be found here).
From this directory
cp GRDBDemo/Secrets.template.swift GRDBDemo/Secrets.swiftThis demo uses GRDB.swift for local data storage and querying. The key differences from the standard PowerSync demo are:
- Queries and mutations are handled using GRDB's data access patterns
- Observable database queries are implemented using GRDB's ValueObservation
If you run into build issues, try:
- Clear Swift caches
rm -rf ~/Library/Caches/org.swift.swiftpm
rm -rf ~/Library/org.swift.swiftpm- In Xcode:
- Reset Packages: File -> Packages -> Reset Package Caches
- Clean Build: Product -> Clean Build Folder.
Build the project, launch the app and sign in or register a new user. The app demonstrates real-time synchronization of todo lists between multiple devices and the cloud, powered by PowerSync's offline-first architecture and GRDB's robust local database capabilities.