grdb

Provide type-safe SQLite access for iOS/macOS apps via GRDB.

2|Updated Sep 13, 2022
One-click install
npx skills add https://github.com/horizontalsystems/solana-kit-ios --skill grdb-horizontalsystems
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grdb
Source: https://github.com/horizontalsystems/solana-kit-ios/tree/main/.claude/skills/grdb
Command: npx skills add https://github.com/horizontalsystems/solana-kit-ios --skill grdb-horizontalsystems

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

GRDB provides direct SQLite access in Swift with a type-safe wrapper, enabling efficient data handling for iOS/macOS apps.

Core Features & Use Cases

  • Type-safe Swift interface for SQLite via GRDB.swift, enabling safe and expressive queries.
  • Migrations and schema evolution with DatabaseMigrator, ensuring versioned changes.
  • Reactive queries via ValueObservation for dynamic UI updates and SwiftUI integration.
  • Support for raw SQL, complex joins, window functions, and performance-oriented operations.
  • Drop-down from SQLiteData when you need GRDB capabilities for specific operations.

Quick Start

Install GRDB via Swift Package Manager, configure a DatabaseQueue or DatabasePool, and start writing type-safe queries.

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 Swift for iOS apps?

Type-safe SQLite queries in Swift are set up by configuring a DatabaseQueue or DatabasePool and writing codable records. This enables safe, expressive queries without raw SQL strings. Install via Swift Package Manager to begin.

How do I handle SQLite database migrations in Swift?

SQLite database migrations in Swift are handled using the DatabaseMigrator. It ensures versioned schema changes are applied safely, allowing your iOS or macOS app to evolve its database structure predictably across updates.

Can I use reactive SQLite queries with SwiftUI?

Reactive SQLite queries integrate with SwiftUI using ValueObservation. This mechanism dynamically updates your UI whenever underlying database values change, providing real-time data synchronization for iOS and macOS applications.

Does GRDB support complex SQLite joins and raw SQL?

GRDB supports complex SQLite joins, raw SQL, and window functions for performance-oriented operations. You can execute these advanced queries directly while maintaining the overall type-safe Swift wrapper benefits.

What's the best way to manage SQLite access at scale in a Swift app?

Managing SQLite access at scale in a Swift app is best achieved using DatabasePool for concurrent reads and complex joins. It supports codable records and reactive queries, ensuring efficient data handling.

When should I drop down from SQLiteData to GRDB?

Drop down from SQLiteData to GRDB when specific operations require advanced capabilities like complex joins, window functions, or ValueObservation. This down-shifting grants access to raw SQL and performance-oriented features.