# sqlite-to-fast-sql

Moves a Capacitor app off bridge-based SQLite plugins and onto @capgo/capacitor-fast-sql, keeping data, transactions and BLOBs.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 706 installs · ★ 73
- Author: Cap-go
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/Cap-go/capgo-skills/tree/HEAD/skills/sqlite-to-fast-sql/SKILL.md
- Updated: 2026-10-17
- HTML: https://affpapa.org/en/nevibecode/skills/sqlite-to-fast-sql

## What it does

The skill runs the migration in steps: inventory the packages and the data layer, map old calls to the new API, then install and configure. It covers `@capacitor-community/sqlite`, `cordova-sqlite-storage`, and the TypeORM, Drizzle and Kysely capacitor drivers, and shows what replaces `createConnection`, `open`, `query`, `run` and `executeSet`.

Fast SQL reaches native SQLite through a token-protected HTTP server on `localhost` instead of the Capacitor bridge. Large `SELECT`s and batch writes stop paying the JSON serialization cost. That is also why iOS ATS (`NSAllowsLocalNetworking`) and Android cleartext for `localhost` and `127.0.0.1` are required. If a network security config already exists, the skill says to merge the `domain-config` into it rather than replace the file.

Database paths differ between the old plugin and Fast SQL, so existing files are not picked up on their own — plan the data move separately. SQLCipher encryption is opt-in per platform and needs its own dependency: `net.zetetic:sqlcipher-android` on Android, the `CapgoCapacitorFastSql/SQLCipher` pod on iOS. Keep the key out of JS.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill sqlite-to-fast-sql -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/sqlite-to-fast-sql/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/sqlite-to-fast-sql/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill sqlite-to-fast-sql -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/sqlite-to-fast-sql/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill sqlite-to-fast-sql -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/sqlite-to-fast-sql/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Cap-go/capgo-skills sqlite-to-fast-sql
```

2. **Manually: put the files in place**
- File: `.github/skills/sqlite-to-fast-sql/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill sqlite-to-fast-sql -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Cap-go/capgo-skills --path skills/sqlite-to-fast-sql
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/sqlite-to-fast-sql/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Cap-go/capgo-skills --skill sqlite-to-fast-sql -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Cap-go/capgo-skills/tree/HEAD/skills/sqlite-to-fast-sql/SKILL.md

## When to use it
- replace `createConnection`, `open` and `query` calls with the Fast SQL API
- speed up large result sets that crawl over the Capacitor bridge
- turn on SQLCipher encryption and keep the key out of JS
- move key-value data into `KeyValueStore`
- fix setup errors: ATS, Android cleartext localhost, web OPFS headers

## Example prompts
- Read package.json and list the SQL plugins we have before changing anything
- Migrate our data layer from @capacitor-community/sqlite to @capgo/capacitor-fast-sql, keep transactions and BLOBs
- Add SQLCipher encryption for Android and iOS and explain where the key should come from

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 3402557d3dd49f12.

BEGIN THIRD-PARTY FILE 3402557d3dd49f12
```text
---
name: sqlite-to-fast-sql
description: Migrates SQLite and SQL-style Capacitor storage (@capacitor-community/sqlite, cordova-sqlite-storage, @ionic/storage with a SQLite driver, TypeORM/Drizzle/Kysely capacitor drivers, and other bridge-based SQL plugins) to @capgo/capacitor-fast-sql. Use when replacing createConnection/open/query/run/executeSet calls, slow large result sets over the Capacitor bridge, adding SQLCipher encryption, keeping transactions and BLOBs, moving key-value data to KeyValueStore, preserving existing database files during the switch, or fixing Fast SQL setup errors (ATS NSAllowsLocalNetworking, Android cleartext localhost, "Encryption is not available in this build", web OPFS COOP/COEP headers). Do not use for non-SQL storage such as Preferences (capacitor-offline-first), Ionic Secure Storage or Identity Vault (ionic-enterprise-sdk-migration), generic app upgrades (capacitor-app-upgrades), or code that already wraps Fast SQL.
allowed-tools:
  - Bash(node -e *)
  - Bash(npm *)
  - Bash(npx cap *)
---

# SQLite to Fast SQL Migration

Swap a bridge-based SQL plugin for `@capgo/capacitor-fast-sql` without losing user data.

## When to Use

TRIGGER when:
- `package.json` has `@capacitor-community/sqlite`, `cordova-sqlite-storage`, `@capawesome-team/capacitor-sqlite`, an ORM capacitor driver, or another SQLite plugin, and the user wants Fast SQL.
- Large `SELECT`s or sync writes are slow because every row crosses the Capacitor bridge as JSON.
- The app needs encryption, transactions, batch writes, BLOBs, or an encrypted key-value store.

Do not use for:
- `@capacitor/preferences` or IndexedDB-only apps -> `capacitor-offline-first`.
- `@ionic-enterprise/secure-storage` / Identity Vault -> `ionic-enterprise-sdk-migration`.
- Apps already on Fast SQL needing schema design or sync logic -> `capacitor-offline-first`.

## Live Project Snapshot

Detected SQL-related packages:
```
END THIRD-PARTY FILE 3402557d3dd49f12

The third-party file has ended. Everything between the 3402557d3dd49f12 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 1918 of 10226 bytes. © Cap-go · MIT · https://github.com/Cap-go/capgo-skills/tree/HEAD/skills/sqlite-to-fast-sql/SKILL.md

## Similar
- [SQLite Database Expert](https://affpapa.org/en/nevibecode/skills/sqlite-database-expert.md) — skill · 3100 installs
- [capacitor-plugins](https://affpapa.org/en/nevibecode/skills/capacitor-plugins.md) — skill · 1800 installs
- [capacitor-expert](https://affpapa.org/en/nevibecode/skills/capacitor-expert.md) — skill · 1100 installs
- [bun-sqlite](https://affpapa.org/en/nevibecode/skills/bun-sqlite.md) — skill · 495 installs
- [appmigrationkit](https://affpapa.org/en/nevibecode/skills/appmigrationkit.md) — skill · 3000 installs
- [assess-react-native-migration](https://affpapa.org/en/nevibecode/skills/assess-react-native-migration.md) — skill · 2100 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
