
sqlite-data
Use when working with SQLiteData library (@Table, @FetchAll, @FetchOne macros) for SQLite persistence, queries, writes, migrations, or CloudKit private database sync.
- Installs
- 186
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill sqlite-data- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads sqlite-data automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
SQLite Data
SQLiteData provides type-safe SQLite access through Swift macros, simplifying database modeling and queries while handling CloudKit sync, migrations, and async patterns automatically.
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.
| Reference | Load When |
|---|---|
| Table Models | Defining tables with @Table, setting up primary keys, columns, or enums |
| Queries - Basics | Using @FetchAll, @FetchOne, @Selection, filtering, ordering, or joins |
| Queries - Advanced | Using @Fetch with FetchKeyRequest, dynamic queries, recursive CTEs, or direct reads |
| Writes | Inserting, updating, upserting, deleting records, or managing transactions |
| Views - SwiftUI | Using @FetchAll/@FetchOne in SwiftUI views, @Observable models, or animations |
| Views - Integration | UIKit integration, dynamic query loading, TCA integration, or observe {} |
| Migrations | Creating database migrations with DatabaseMigrator or #sql() macro |
| CloudKit Sync | Setting up CloudKit private database sync, sharing, or sync delegates |
| Dependencies | Injecting database/sync engine via @Dependency, bootstrap patterns, or TCA integration |
| Testing | Setting up test databases, seeding data, or writing assertions for SQLite code |
| Advanced - Queries | Implementing triggers, custom database functions, or full-text search (FTS5) |
| Advanced - Optimization | Performance tuning, indexes, custom aggregates, JSON aggregation, or self-joins |
| Schema Composition | Using @Selection column groups, single-table inheritance, or database views |
Core Workflow
When working with SQLiteData:
- Define table models with
@Tablemacro - Use
@FetchAll/@FetchOneproperty wrappers in views or@Observablemodels - Access database via
@Dependency(\.defaultDatabase) - Perform writes in
database.write { }transactions - Set up migrations before first use
Common Mistakes
-
N+1 query patterns — Loading records one-by-one in a loop (e.g., fetching user then fetching all their posts separately) kills performance. Use joins or batch fetches instead.
-
Missing migrations on schema changes — Modifying
@Tablewithout creating a migration causes crashes at runtime. Always create migrations for schema changes before deploying. -
Improper transaction handling — Long-running transactions outside of
database.write { }block can cause deadlocks or data loss. Keep write blocks short and focused. -
Ignoring CloudKit sync delegates — Setting up CloudKit sync without implementing
SyncDelegatemeans you miss error handling and conflict resolution. Implement all delegate methods for production. -
Over-fetching in SwiftUI views — Using
@FetchAllwithout filtering/limiting can load thousands of records, freezing the UI. Use predicates, limits, and sorting to keep in-memory footprint small.
FAQ
What does the sqlite-data skill do?
Use when working with SQLiteData library (@Table, @FetchAll, @FetchOne macros) for SQLite persistence, queries, writes, migrations, or CloudKit private database sync.
How do I install sqlite-data?
Run npx skills add https://github.com/johnrogers/claude-swift-engineering --skill sqlite-data in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sqlite-data/ (personal) or .claude/skills/sqlite-data/ (project).
Which AI agents can use sqlite-data?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is sqlite-data safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains sqlite-data?
It is published by johnrogers in johnrogers/claude-swift-engineering. It has 186 recorded installs.
More from johnrogers/claude-swift-engineering
swift-style
johnrogers/claude-swift-engineering
Swift code style conventions for clean, readable code. Use when writing Swift code to ensure consistent formatting, naming, organization, and idiomatic patterns.
ios-hig
johnrogers/claude-swift-engineering
Open the skill to read its SKILL.md instructions.
swiftui-patterns
johnrogers/claude-swift-engineering
Open the skill to read its SKILL.md instructions.
ios-26-platform
johnrogers/claude-swift-engineering
Use when implementing iOS 26 features (Liquid Glass, new SwiftUI APIs, WebView, Chart3D), deploying iOS 26+ apps, or supporting backward compatibility with iOS 17/18.
composable-architecture
johnrogers/claude-swift-engineering
Use when building features with TCA (The Composable Architecture), structuring reducers, managing state, handling effects, navigation, or testing TCA features. Covers @Reducer, Store, Effect, TestStore, reducer composition, and TCA patterns.
swift-testing
johnrogers/claude-swift-engineering
Use when writing tests with Swift Testing (@Test,
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.