grdb

Execute raw SQL against SQLite databases using GRDB in Swift.

1.1k|81|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/CharlesWiltgen/Axiom --skill grdb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grdb
Source: https://github.com/CharlesWiltgen/Axiom/tree/main/.claude-plugin/plugins/axiom/skills/grdb
Command: npx skills add https://github.com/CharlesWiltgen/Axiom --skill grdb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Direct SQLite access with type-safe queries, migrations, and reactive observations when you need complex joins, aggregations, or fine-grained performance control.

Core Features & Use Cases

  • Complex SQL joins across multiple tables with type-safe wrappers.
  • ValueObservation for reactive UI updates.
  • DatabaseMigrator patterns for safe migrations and upgrades.

Quick Start

Prompt: "Show me a JOIN across messages and authors with a group count."

Frequently Asked Questions about grdb

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

FAQPage Schema
How do I execute complex SQL joins in Swift with type safety?

GRDB provides type-safe SQLite query execution with complex joins across multiple tables. Use raw SQL wrapped in typed interfaces with Codable or PersistableRecord to maintain compile-time safety while joining messages, authors, and other tables with aggregations and filtering.

Can I use SQLite with reactive updates in my iOS app?

Yes. GRDB's ValueObservation enables reactive UI updates by observing SQLite query results and automatically notifying your app when data changes, eliminating manual refresh logic while maintaining type safety across iOS 13+ and macOS.

How do I safely migrate SQLite databases without data loss?

GRDB's DatabaseMigrator pattern manages schema upgrades sequentially and safely. Define migrations as versioned steps, apply them automatically on app launch, and roll back failed migrations to prevent data corruption during app updates.

What's the best way to optimize SQLite query performance in Swift?

GRDB supports DatabaseQueue for single-threaded apps and DatabasePool for concurrent access, giving you explicit control over performance trade-offs. Profile complex joins and aggregations to tune query execution and manage contention across iOS and macOS targets.

Does GRDB work with existing SQLite databases in production apps?

Yes, GRDB accesses existing SQLite databases directly with raw SQL and typed interfaces. It requires iOS 13+ and Swift 5.7+, supports both DatabaseQueue and DatabasePool for different concurrency models, and integrates migrations for schema evolution.

When should I choose raw SQL over higher-level query builders?

Use GRDB's raw SQL when you need complex joins, custom aggregations, or fine-grained performance control that query builders obscure. Type-safe wrappers prevent runtime errors while preserving SQL's expressiveness for sophisticated multi-table operations.