sqlite-data

Provide type-safe SQLite data access for Swift apps using SQLiteData macros.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

sqlite-data provides a type-safe approach to modeling and querying SQLite databases in Swift using the SQLiteData macros, reducing boilerplate and improving reliability.

Core Features & Use Cases

  • Type-safe table modeling with @Table and composite keys
  • Macros-based queries like @FetchAll/@FetchOne and migrations
  • CloudKit private database sync integration
  • Dependency injection via Swift's dependency system for a shared database context

Quick Start

Create a Swift model using @Table, run migrations, and fetch data with @FetchAll in a view

Frequently Asked Questions about sqlite-data

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

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

Type-safe SQLite access in Swift apps is achieved by defining models with the @Table macro and querying data using @FetchAll or @FetchOne, eliminating boilerplate. A central database context handles migrations and dependency injection.

Does this SQLite Swift library support CloudKit sync across iOS and macOS?

Yes, the SQLite data access implementation supports CloudKit private database sync across iOS and macOS. This enables robust local persistence that automatically synchronizes with cloud storage for connected Apple platforms.

How do I handle database migrations with Swift macros?

Database migrations are handled natively by the SQLiteData macro system alongside @Table definitions. You run migrations through a central database context to safely evolve your schema while maintaining type-safe querying capabilities.

What's the best way to model composite keys in a SQLite database using Swift?

Modeling composite keys in SQLite is done using the @Table macro, which natively supports type-safe definitions for complex primary keys. This ensures robust local persistence without manual SQL boilerplate.

Can I use dependency injection to manage a shared SQLite database context in Swift?

Yes, dependency injection is managed via Swift's dependency system to provide a shared database context. This central context handles writes, migrations, and queries seamlessly across your application architecture.

When do I need type-safe SQLite macros for local persistence instead of a standard ORM?

Type-safe SQLite macros are needed when you require robust local persistence with compile-time safety, CloudKit private database sync, and macro-driven queries like @FetchAll, reducing boilerplate compared to standard ORM approaches.