Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
johnrogers avatar

Grdb

  • 146 installs
  • 222 repo stars
  • Updated January 18, 2026
  • johnrogers/claude-swift-engineering

Model, migrate, query, and observe SQLite in Swift/iOS apps using GRDB with safe concurrency, migrations, and performance-conscious access patterns.

About

GRDB skill teaches SQLite in Swift via GRDB: define tables and migrations, use typed records and SQL builders, handle concurrent reads/writes, observe changes for SwiftUI, and avoid common pitfalls around threading, transactions, and migration versioning in iOS apps.

  • GRDB schema and migrations
  • Typed queries and records
  • Concurrency and WAL tuning
  • Observation and UI binding
  • Migration safety patterns

Grdb by the numbers

  • 146 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #271 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill grdb

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs146
repo stars222
Last updatedJanuary 18, 2026
Repositoryjohnrogers/claude-swift-engineering

What it does

Model, migrate, query, and observe SQLite in Swift/iOS apps using GRDB with safe concurrency, migrations, and performance-conscious access patterns.

Files

SKILL.mdMarkdownGitHub ↗

GRDB

Direct SQLite access using GRDB.swift - type-safe Swift wrapper with full SQLite power when you need it.

Reference Loading Guide

ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.

ReferenceLoad When
[Getting Started](references/getting-started.md)Setting up DatabaseQueue or DatabasePool
[Queries](references/queries.md)Writing raw SQL, Record types, type-safe queries
[Value Observation](references/value-observation.md)Reactive queries, SwiftUI integration
[Migrations](references/migrations.md)DatabaseMigrator, schema evolution
[Performance](references/performance.md)EXPLAIN QUERY PLAN, indexing, profiling

When to Use GRDB vs SQLiteData

ScenarioUse
Type-safe @Table modelsSQLiteData
CloudKit sync neededSQLiteData
Complex joins (4+ tables)GRDB
Window functions (ROW_NUMBER, RANK)GRDB
Performance-critical raw SQLGRDB
Reactive queries (ValueObservation)GRDB

Core Workflow

1. Choose DatabaseQueue (single connection) or DatabasePool (concurrent reads) 2. Define migrations with DatabaseMigrator 3. Create Record types (Codable, FetchableRecord, PersistableRecord) 4. Write queries with raw SQL or QueryInterface 5. Use ValueObservation for reactive updates

Requirements

  • iOS 13+, macOS 10.15+
  • Swift 5.7+
  • GRDB.swift 6.0+

Common Mistakes

1. Performance assumptions without EXPLAIN PLAN — Assuming your query is fast or slow without checking EXPLAIN QUERY PLAN is guessing. Always profile queries with EXPLAIN before optimizing.

2. Missing indexes on WHERE clauses — Queries filtering on non-indexed columns scan the entire table. Index any column used in WHERE, JOIN, or ORDER BY clauses for large tables.

3. Improper migration ordering — Running migrations out of order or skipping intermediate versions breaks schema consistency. Always apply migrations sequentially; never jump versions.

4. Record conformance shortcuts — Not conforming Record types to PersistableRecord or FetchableRecord correctly leads to silent data loss or deserialization failures. Always implement all required protocols correctly.

5. ValueObservation without proper cleanup — Forgetting to cancel ValueObservation when views disappear causes memory leaks and stale data subscriptions. Store the cancellable and clean up in deinit.

Related skills

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.