grdb

Configure GRDB DatabaseQueue or DatabasePool for type-safe SQLite queries and migrations.

223|21|Updated Dec 20, 2025
One-click install
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill grdb-johnrogers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grdb
Source: https://github.com/johnrogers/claude-swift-engineering/tree/main/plugins/swift-engineering/skills/grdb
Command: npx skills add https://github.com/johnrogers/claude-swift-engineering --skill grdb-johnrogers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Swift developers often face challenges writing safe, maintainable SQLite queries, keeping migrations in sync, and building reactive data flows. GRDB provides a type-safe wrapper around SQLite, robust tooling for migrations, and support for reactive updates, enabling precise control over data access while preserving Swift type safety.

Core Features & Use Cases

  • Type-safe query interface for raw SQL and Swift model integration (Codable + PersistableRecord, FetchableRecord)
  • Database migrations via DatabaseMigrator with robust schema evolution
  • Reactive data updates using ValueObservation, with seamless SwiftUI/Combine integration
  • Ability to drop down to raw GRDB SQL for performance-critical operations while maintaining safety
  • Support for 4+ table joins, window functions, and complex data access patterns

Quick Start

Install GRDB.swift, configure a DatabaseQueue or DatabasePool, and begin defining migrations and queries for your data models.

Frequently Asked Questions about grdb

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up type-safe SQLite queries in a Swift app?

Type-safe SQLite queries in a Swift app require configuring a DatabaseQueue or DatabasePool to manage connections. You can then define record types using FetchableRecord and PersistableRecord to execute queries while preserving Swift type safety.

How do I handle SQLite database migrations in iOS projects?

SQLite database migrations in iOS projects are handled using a DatabaseMigrator. This provides robust schema evolution by allowing you to define and apply sequential migration blocks securely within your Swift application.

How does ValueObservation work for reactive SQLite data updates in SwiftUI?

ValueObservation enables reactive SQLite data updates by monitoring database changes and emitting fresh values automatically. It integrates seamlessly with SwiftUI and Combine to trigger UI refreshes whenever underlying records are modified.

Can I execute raw SQL for performance-critical SQLite operations while keeping Swift type safety?

You can execute raw SQL for performance-critical SQLite operations while maintaining Swift type safety. GRDB allows dropping down to raw SQL strings when needed, returning typed records through FetchableRecord protocols.

Does GRDB support complex SQLite queries like 4+ table joins and window functions?

GRDB supports complex SQLite queries including 4+ table joins and window functions. It enables these complex data access patterns through its type-safe query interface and raw SQL capabilities for advanced data retrieval.

What is the best way to configure a DatabasePool for SQLite access in macOS applications?

The best way to configure SQLite access in macOS applications is setting up a DatabasePool to handle concurrent database reads and a single writer. This allows safe, multi-threaded data access for complex Swift queries and reactive data flows.