Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. GRDB.swift

GRDB.swift

MITSwiftv7.11.1

A Swift toolkit for SQLite databases with a focus on application development, providing SQL generation, database observation, and robust concurrency.

GitHubGitHub
8.6k stars993 forks0 contributors

What is GRDB.swift?

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.

Target Audience

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.

Value Proposition

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.

Overview

A toolkit for SQLite databases, with a focus on application development

Use Cases

Best For

  • Building iOS/macOS apps with local SQLite persistence
  • Applications needing real-time database change observation
  • Swift projects requiring type-safe database queries
  • Multi-threaded applications with concurrent database access
  • Apps that need database schema migrations between versions
  • Developers who want SQL convenience without losing SQLite control

Not Ideal For

  • Projects targeting non-Apple platforms like Linux or Windows
  • Applications needing out-of-the-box cloud synchronization or server-side database hosting
  • Teams requiring Carthage for dependency management in iOS projects
  • Developers who prefer ORMs with automatic schema inference over explicit migrations

Pros & Cons

Pros

Swift-Native Type Safety

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.

Robust Concurrency Support

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.

Comprehensive Built-in Tools

Includes migrations, database observation with Combine/RxSwift/Swift concurrency hooks, and full-text search, reducing the need for external libraries for common app needs.

SQLite Transparency

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.

Cons

Apple Platform Exclusivity

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.

Dependency Management Quirks

Carthage is unsupported, and CocoaPods has deployment issues requiring manual branch or tag dependencies, complicating setup for teams using these tools.

Complex Custom SQLite Setup

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.

Frequently Asked Questions

Quick Stats

Stars8,563
Forks993
Contributors0
Open Issues4
Last commit1 month ago
CreatedSince 2015

Tags

#orm#database#ios#migrations#tvos#spm#sqlite#sql-builder#concurrency#watchos#swift#macos#sql

Built With

S
SQLite
S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 5 hours ago

Related Projects

MMKVMMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, POSIX, and OHOS.

Stars18,680
Forks1,986
Last commit28 days ago
RealmRealm

Realm is a mobile database: a replacement for Core Data & SQLite

Stars16,608
Forks2,234
Last commit1 month ago
FMDBFMDB

A Cocoa / Objective-C wrapper around SQLite

Stars13,840
Forks2,734
Last commit4 months ago
WCDBWCDB

WCDB is a cross-platform database framework developed by WeChat.

Stars11,616
Forks1,505
Last commit3 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub