DEV.co
Open-Source Databases · pointfreeco

sqlite-data

SQLiteData is a Swift library that replaces Apple's SwiftData with a SQLite-based alternative, adding CloudKit synchronization. It provides SwiftUI-compatible property wrappers (@Table, @FetchAll) for database operations with a reported performance profile comparable to raw SQLite C APIs.

Source: GitHub — github.com/pointfreeco/sqlite-data
1.9k
GitHub stars
122
Forks
Swift
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorypointfreeco/sqlite-data
Ownerpointfreeco
Primary languageSwift
LicenseMIT — OSI-approved
Stars1.9k
Forks122
Open issues29
Latest release1.6.6 (2026-06-10)
Last updated2026-07-07
Sourcehttps://github.com/pointfreeco/sqlite-data

What sqlite-data is

Built on GRDB, SQLiteData offers SQL-powered persistence with observation support via Swift property wrappers and dependency injection. It implements CloudKit sync at the engine level and uses structured query decoding, positioning itself between raw SQLite and abstraction-heavy ORMs.

Quickstart

Get the sqlite-data source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/pointfreeco/sqlite-data.gitcd sqlite-data# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

iOS/macOS apps requiring CloudKit sync

Native replacement for SwiftData when cross-device synchronization and iCloud integration are core requirements. The SyncEngine handles bidirectional sync without requiring separate backend infrastructure.

High-performance local persistence

Apps with heavy read/write patterns or large datasets where SwiftData overhead is unacceptable. Benchmarks show 8.5s vs 18.8s (GRDB manual) for Orders.fetchAll test on 1M+ record sets.

SQLite-first architectures with Swift frontends

Teams comfortable with SQL who want type-safe Swift bindings and real-time observation. Allows fine-grained query control (sorting by boolean, counting without full fetch) unavailable in SwiftData.

Implementation considerations

  • Requires explicit DatabaseQueue setup at app init; no automatic schema inference like SwiftData. Migration strategy must be planned upfront.
  • CloudKit sync via SyncEngine is opt-in and demands understanding of CloudKit record semantics (e.g., field size limits, zone sharing). Test sharing workflows early.
  • Property wrappers (@FetchAll, @FetchOne) rely on dependency injection via prepareDependencies. Ensure this is called before any view initialization.
  • Observation mechanism is built-in but scoped to SwiftUI by design. UIKit/Combine usage requires manual subscription to database changes.
  • Performance gains assume appropriate indexing and query patterns. Unoptimized queries will negate speed advantages over SwiftData.

When to avoid it — and what to weigh

  • No SQL expertise on team — While property wrappers abstract common patterns, CloudKit sync configuration, schema migrations, and troubleshooting require SQLite knowledge. SwiftData's opaque model approach may suit non-database teams better.
  • Multi-platform database (Android, web, server) — SQLiteData is Swift/Apple-only. Teams needing shared persistence layer across platforms should use server-backed APIs or platform-agnostic solutions.
  • Distributed systems or eventual consistency needs — CloudKit sync is suitable for user-owned iCloud data but not for collaborative editing or complex conflict resolution. Requires careful schema design around CloudKit record limitations.
  • Complex relational queries or complex migrations — Limited documentation on advanced schema versioning, foreign key constraints, or multi-table transaction patterns. Hand-written migrations may become fragile in evolving codebases.

License & commercial use

Licensed under MIT (permissive, OSI-approved). Allows commercial use, modification, and distribution with attribution.

MIT license permits unrestricted commercial use in proprietary apps. No copyleft or derivative-disclosure requirements. However, verify Point-Free's subscription model separately if leveraging their video content for team training; the library itself is freely usable in production.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No security audit data provided. Standard SQLite considerations apply: ensure database file permissions restrict access to app sandbox (default on iOS/macOS). CloudKit sync transmits data to iCloud; assume encrypted in transit but verify compliance with data residency/sovereignty requirements. User must implement application-level encryption if handling sensitive data. No mention of SQL injection prevention mechanisms (though prepared statements via GRDB likely mitigate this).

Alternatives to consider

SwiftData (Apple)

Official, opaque abstraction. Simpler for teams avoiding SQL, but slower performance, less query control, no cross-device sync without manual backend.

Realm Swift

Mature, cross-platform mobile database with conflict resolution. Requires licensing for commercial use and larger footprint; better for complex schemas and Android interop.

GRDB directly

Raw SQLite with excellent Swift bindings and lower-level control. No CloudKit sync, requires manual observation wiring, but maximum flexibility.

Software development agency

Build on sqlite-data with DEV.co software developers

Review the comparison with SwiftData, test CloudKit sync in a non-production environment, and assess schema migration strategy before committing.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

sqlite-data FAQ

Is CloudKit sync production-ready?
SyncEngine is available and documented, but README lacks case studies or failure-mode guidance. Recommend pilot deployment and thorough offline/conflict testing before wide rollout.
Do I need to write SQL?
For common operations (insert, fetch, delete), property wrappers hide SQL. For filtering/sorting, you use Swift keypaths (e.g., Item.where(\.isInStock)). Schema definition and migrations require raw SQL or external tooling.
Can I use this on the backend (Server-Side Swift)?
Not without significant rework. SQLiteData is tightly coupled to SwiftUI observation and Apple's dependency injection. Use raw SQLite, PostgreSQL, or GRDB directly for server persistence.
How does performance compare to raw SQLite?
Benchmarks show 8.5s (SQLiteData 1.0.0) vs 7.2s (raw SQLite) on Orders.fetchAll, indicating ~18% overhead from abstraction. Still competitive with GRDB (18.8s) and significantly faster than SQLite.swift (28s).

Custom software development services

DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If sqlite-data is part of your open-source databases roadmap, our team can implement, customize, migrate, and maintain it.

Evaluate SQLiteData for Your App

Review the comparison with SwiftData, test CloudKit sync in a non-production environment, and assess schema migration strategy before committing.