Hi everyone,
I’ve just started a new project using Capacitor 8.0.0 (Blazor WASM) and I am looking for a reliable, SPM-compatible database solution for iOS and MacCatalyst.
As many of you know, Capacitor 8 relies heavily on the Swift Package Manager. I’ve tried the community SQLite plugins, but I’m facing significant build issues on macOS (errors like Missing package product CapApp-SPM or compilation failures in Xcode). It seems the migration path for free SQLite plugins to version 8 is still very rocky.
My requirements:
-
Persistent Storage: Data must survive WebView cache purges (stored in native folders).
-
MacCatalyst Support: Essential for my desktop target.
-
License: Preferably free / open-source.
My Questions:
-
Are there any native DB plugins (SQL or NoSQL) that are already fully compatible with Capacitor 8’s SPM structure?
-
Given the current plugin situation, would it be a “best practice” to use SQLite WASM inside the WebView and persist the data via the @capacitor/filesystem plugin instead?
I want to avoid a “legacy” setup with CocoaPods and stay within the modern Capacitor 8 ecosystem. Any advice from those already working with v8 would be great!
pc
Have you considered switching from Capacitor to .NET MAUI (Blazor Hybrid)?
Microsoft’s official solution for running Blazor natively and lets you use standard NuGet packages for SQLite, which completely avoids the JS bridge and SPM headaches you’re facing.
Thanks for the suggestion.
We have been using .NET MAUI Blazor professionally since its initial release, following many years of experience with WPF on Windows and later Blazor for web applications. At the beginning, MAUI had several fundamental issues, which we expected to be resolved relatively quickly as the framework matured. Unfortunately, that did not happen in our experience, and some aspects even became more problematic over time.
As a result, we reached a point where it became increasingly difficult to justify MAUI Blazor as a stable long-term choice to our customers. For that reason, we have decided to stop starting new projects with MAUI Blazor.
Blazor itself, however, remains a core technology for us. Its ability to share a large, coherent codebase across platforms is still extremely valuable. Around two months ago, after a concrete incident in a MAUI project, we started evaluating alternatives and successfully completed a proof of concept with the following setup:
- Blazor WASM + Capacitor for Android, iOS, and MacCatalyst
- WPF Blazor for Windows
- Blazor Server for web
We have been working with WPF for over 15 years, so the Windows side is very well understood for us. Capacitor and the JavaScript ecosystem were new territory, but after some initial ramp-up we found the model workable and predictable. Our plan is to first build several internal applications with this stack and later share our findings with the Blazor community.
That’s why, for this project, we are deliberately looking for a stable Capacitor-based solution rather than moving back to MAUI Blazor.
pc
Have you tried: SQLite Plugin for Capacitor - Capawesome ? it supports Capacitor 8.
We used currently the dev version
npm i @capacitor-community/sqlite@7.0.2-dev.5a79381.1766041651
With Swift Package Manager, there are no more problems, and we can now run the project on a physical iPhone. Unfortunately, another problem has arisen, but we are confident that this will also be resolved soon (see Github Issue).
pc
you pointed to the other plugin capacitor-community/sqlite. The one i mentioned above is the @capawesome-team/capacitor-sqlite plugin. These are different.
We know that there are two different plugins, but we prefer the community version.
pc