For encryption support with SQLCipher, see the Encryption guide. For custom SQLite builds, refer to the Custom SQLite Builds documentation.
Requirements
Before installing GRDB, make sure your project meets these requirements:- iOS 13.0+
- macOS 10.15+
- tvOS 13.0+
- watchOS 7.0+
- SQLite 3.20.0+
- Swift 6.1+ / Xcode 16.3+
Swift Package Manager
The Swift Package Manager is the recommended way to install GRDB. It automates the distribution of Swift code and integrates seamlessly with Xcode.Add Package Dependency
In Xcode, select File → Add Package Dependencies…Enter the GRDB repository URL:
Choose Library
GRDB offers two libraries:
- GRDB (recommended) - Standard static library
- GRDB-dynamic - Dynamic framework
Linux Support: Linux support is provided by contributors and is not automatically tested or officially maintained. If you encounter build or runtime issues on Linux, please open a pull request with the necessary fix.
CocoaPods
CocoaPods is a dependency manager for Xcode projects. To use GRDB with CocoaPods (version 1.2 or higher), add it to yourPodfile:
Podfile
Option 1: Use the GRDB7 Branch
This is equivalent topod 'GRDB.swift', '~> 7.0' and tracks the latest GRDB 7.x version:
Podfile
Option 2: Specify a Tagged Version
Pin to a specific version explicitly:Podfile
Manual Installation
If you prefer not to use a dependency manager, you can integrate GRDB manually:Download GRDB
Download the latest release or clone the repository:
Add Target Dependency
In your application target’s settings:
- Go to the Build Phases tab
- In the Target Dependencies section, add the
GRDBtarget
For watchOS, add the dependency to your extension target instead.