A Swift toolkit for SQLite databases with a focus on application development, providing SQL generation, database observation, and robust concurrency.
GRDB.swift is a Swift toolkit for SQLite databases designed specifically for application development on Apple platforms. It provides a high-level API for common database operations like persistence, querying, and observation while maintaining full access to SQLite's raw capabilities when needed. The library solves the problem of bridging Swift's type safety and modern concurrency features with SQLite's relational database model.
iOS, macOS, tvOS, and watchOS developers who need to persist application data in SQLite databases with type safety, concurrency support, and modern Swift patterns. It's particularly suited for developers building data-driven applications who want both convenience and low-level control.
Developers choose GRDB.swift because it offers a comprehensive, Swift-native approach to SQLite that doesn't hide SQLite's power. It provides robust concurrency handling, built-in observation patterns, and a clean API while allowing direct SQL access when needed. The library has been maintained since 2015 and offers production-ready stability with modern Swift feature support.
A toolkit for SQLite databases, with a focus on application development
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a query interface and Record protocols that leverage Swift's Codable and type system, allowing developers to build database queries with compile-time checks instead of raw SQL strings.
Safely handles multi-threaded access with DatabasePool for WAL mode databases, enabling concurrent reads and writes without manual locking, which is essential for responsive apps.
Includes migrations, database observation with Combine/RxSwift/Swift concurrency hooks, and full-text search, reducing the need for external libraries for common app needs.
Provides full access to raw SQL and SQLite APIs when needed, ensuring developers aren't limited by high-level abstractions and can leverage advanced SQLite features directly.
Designed specifically for iOS, macOS, tvOS, and watchOS, making it unsuitable for cross-platform projects targeting Android, web, or server-side Swift without significant workarounds.
Carthage is unsupported, and CocoaPods has deployment issues requiring manual branch or tag dependencies, complicating setup for teams using these tools.
Integrating custom SQLite builds or SQLCipher for encryption involves extra steps and configuration, as noted in the Installation section, which can be error-prone for beginners.