What is GRDB?
GRDB.swift is a comprehensive SQLite toolkit for Swift that helps you build database-driven applications with confidence. Whether you’re building an iOS app, macOS application, or cross-platform Swift project, GRDB provides the tools you need to work efficiently with SQLite databases.SQL Generation
Generate SQL automatically with a type-safe query interface, or write raw SQL when you need full control
Database Observation
Get notified when database values change with ValueObservation and reactive programming support
Robust Concurrency
Multi-threaded applications can efficiently access databases with WAL mode support for concurrent reads and writes
Migrations
Evolve your database schema safely as your application grows and changes over time
Key Features
GRDB provides a comprehensive set of features for SQLite database development:- Record Protocols: Define your models with
FetchableRecordandPersistableRecordfor automatic persistence - Query Interface: Build type-safe queries with Swift’s expressive syntax
- Full-Text Search: Leverage SQLite’s FTS3, FTS4, and FTS5 engines for powerful text search
- Swift Concurrency: First-class support for async/await and structured concurrency
- Combine Support: Reactive database access with Combine publishers
- Type-Safe SQL: Use SQL interpolation to prevent injection vulnerabilities
- Associations: Define relationships between records with belongs-to, has-many, and has-one associations
- Database Encryption: Secure your data with SQLCipher integration
Why Choose GRDB?
Battle-Tested Reliability
Battle-Tested Reliability
GRDB has been serving the Swift community since 2015, with over 8,000 stars on GitHub and widespread adoption in production applications.
Performance Focused
Performance Focused
Built with performance in mind, GRDB provides direct access to SQLite while adding zero-cost abstractions for common operations.
Comprehensive Documentation
Comprehensive Documentation
Extensive documentation, guides, and examples help you get started quickly and master advanced features.
Active Development
Active Development
Regular updates bring support for new Swift versions, performance improvements, and feature enhancements.
Quick Example
Here’s a taste of what working with GRDB looks like:Platform Support
GRDB supports all Apple platforms and Linux:- iOS 13.0+
- macOS 10.15+
- tvOS 13.0+
- watchOS 7.0+
- Linux (community supported)
GRDB requires Swift 6.1+ and Xcode 16.3+. Make sure your development environment meets these requirements.
Next Steps
Installation
Add GRDB to your project with Swift Package Manager, CocoaPods, or manual installation
Quickstart
Build your first GRDB application in minutes with our quickstart guide
Core Concepts
Learn the fundamental concepts of working with GRDB databases
API Reference
Explore the complete GRDB API documentation