[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ET5QG2MZWPVNGN84G3WD33":3,"skill-same:01M7ET5QG2MZWPVNGN84G3WD33":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7ET5QG2MZWPVNGN84G3WD33","sqlite-turso",null,"Use when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a local replica synced to a remote primary — plus WAL mode and SQLite's single-writer model and its lock errors. NOT Drizzle schema or queries on libSQL (that is `drizzle-orm`), NOT versioned up\u002Fdown migrations (that is `db-migrations`), NOT serverless Postgres with branching (that is `neon`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fsqlite-turso\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sqlite-turso\ndescription: \"Use when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a local replica synced to a remote primary — plus WAL mode and SQLite's single-writer model and its lock errors. NOT Drizzle schema or queries on libSQL (that is `drizzle-orm`), NOT versioned up\u002Fdown migrations (that is `db-migrations`), NOT serverless Postgres with branching (that is `neon`).\"\ntags: [sqlite, turso, libsql, edge, embedded-replica, local-first, wal]\nrecommends: [drizzle-orm, db-migrations, postgresdb, neon, backups, sql]\norigin: risco\n---\n\n# SQLite & Turso\u002FlibSQL — decide, connect, operate\n\nSQLite is an in-process, single-file, **single-writer** relational engine. Turso\u002FlibSQL is the\nfork that adds a remote edge database and — the part people actually want — **embedded replicas**:\na local SQLite file that syncs to a remote primary, so reads are microsecond-local and writes still\nland durably in the cloud.\n\nThis skill is **decide + connect + operate**. It owns the engine truths (WAL, single writer,\npragmas), the three deployment shapes, and wiring the current `@libsql\u002Fclient`. It does NOT own\nschema modeling or type-safe queries (that is `drizzle-orm`), versioned migration files (that is\n`db-migrations`), or backup strategy as a primary task (that is `backups`).\n\n## Is SQLite\u002FTurso the right tool?\n\nDecide first. Picking SQLite for a high-write multi-writer workload is the mistake that wastes a week.\n\n| Workload | Verdict | Why \u002F route |\n|---|---|---|\n| Read-heavy, single-tenant, low-to-moderate writes | **SQLite\u002FTurso** | One writer is plenty; reads are local and fast. |\n| Local-first \u002F offline \u002F edge app needing cloud durability | **Turso embedded replica** | Local file for reads, syncs to a remote primary. |\n| Database-per-user \u002F per-tenant at scale | **Turso** | Unlimited databases on the free tier; cheap isolation. |\n| Many concurrent writers, complex roles, extensions | No → `postgresdb` (or `mysql`) | SQLite serializes writers; one writer at a time. |\n| Serverless Postgres with branching | No → `neon` | Turso is serverless *SQLite*, not Postgres. |\n| MySQL-compatible serverless | No → `planetscale` | Different engine and protocol. |\n| Auth + realtime + storage + Postgres bundled | No → `supabase` | You want a BaaS, not a raw SQL engine. |\n| Columnar OLAP \u002F analytical aggregates | No → `duckdb` | SQLite\u002FTurso is OLTP, row-oriented. |\n| Ephemeral cache \u002F KV | No → `redis` | Not a durable relational store. |\n\n## Three deployment shapes\n\nEvery Turso\u002FlibSQL decision reduces to which of these three you are wiring. The URL scheme picks the\ntransport automatically.\n\n| Shape | `createClient` config | Latency | When |\n|---|---|---|---|\n| **Local file** | `url: \"file:local.db\"` | In-process | Dev, CLI tools, single-node app, tests. |\n| **Remote edge DB** | `url: \"libsql:\u002F\u002F\u003Cdb>.turso.io\"` + `authToken` | Network round-trip | Serverless\u002Fstateless functions; no local disk to sync. |\n| **Embedded replica** | `url: \"file:local.db\"` + `syncUrl` + `authToken` | Microsecond reads | Local-first\u002Fedge with cloud durability — the flagship. |\n\n`libsql:\u002F\u002F` resolves to HTTPS\u002FWSS. `file:` is native. `https:`\u002F`http:` is Hrana HTTP, `wss:`\u002F`ws:`\nis Hrana WebSocket. You rarely set the scheme by hand — you set the URL and the client chooses.\n\n## Connect with `@libsql\u002Fclient`\n\nCurrent client is **`@libsql\u002Fclient` v0.17.x**. Never hardcode the auth token — read it from the\nenvironment. Convention: `TURSO_DATABASE_URL` and `TURSO_AUTH_TOKEN`.\n\n```ts\n\u002F\u002F 1. Local file — dev, tests, single node\nimport { createClient } from \"@libsql\u002Fclient\";\n\nconst db = createClient({ url: \"file:local.db\" });\n```\n\n```ts\n\u002F\u002F 2. Remote edge DB — serverless, no local disk\nimport { createClient } from \"@libsql\u002Fclient\";\n\nconst db = createClient({\n  url: process.env.TURSO_DATABASE_URL!,   \u002F\u002F libsql:\u002F\u002F\u003Cdb>.turso.io\n  authToken: process.env.TURSO_AUTH_TOKEN!,\n});\n```\n\n```ts\n\u002F\u002F 3. Embedded replica — local reads, syncs to the primary\nimport { createClient } from \"@libsql\u002Fclient\";\n\nconst db = createClient({\n  url: \"file:local.db\",                   \u002F\u002F MUST be a local file\n  syncUrl: process.env.TURSO_DATABASE_URL!,\n  authToken: process.env.TURSO_AUTH_TOKEN!,\n  syncInterval: 60,                        \u002F\u002F seconds; or call db.sync() manually\n});\n```\n\nRule: an embedded replica's `url` is **always** a local `file:` — `syncUrl` is the remote. If you\nset `syncUrl` next to a `libsql:\u002F\u002F` url you have not built a replica, you have a confused remote\nclient. (verify.sh enforces exactly this.)\n\nIn serverless\u002Fedge runtimes the import is the same; just confirm the runtime exposes a writable temp\npath for the `file:` replica, or fall back to shape #2 (remote-only).\n\n## WAL and the pragmas you must set\n\nFor any **local file** or **embedded replica** connection, set these per-connection on open. They do\nnot apply to a remote-only client (the primary already runs WAL server-side).\n\n```sql\nPRAGMA journal_mode = WAL;     -- concurrent readers + one writer; default rollback-journal blocks readers during writes\nPRAGMA busy_timeout = 5000;    -- wait up to 5s for the write lock instead of erroring SQLITE_BUSY immediately\nPRAGMA foreign_keys = ON;      -- FK enforcement is OFF by default and is PER-CONNECTION — set it every time\nPRAGMA synchronous = NORMAL;   -- safe with WAL; far fewer fsyncs than the default FULL\n```\n\n`journal_mode` is persistent once set on the file; `busy_timeout`, `foreign_keys`, and `synchronous`\nare per-connection — re-issue them on every new connection (and in pooled environments, on checkout).\n\n## Writes, batches, transactions\n\nAlways parameterize. String-concatenated SQL is an injection hole and defeats statement caching.\n\n```ts\n\u002F\u002F Bad — string interpolation\nawait db.execute(`INSERT INTO users (email) VALUES ('${email}')`);\n\n\u002F\u002F Good — positional ? args (named $name and tuple [sql, args] forms also work)\nawait db.execute({ sql: \"INSERT INTO users (email) VALUES (?)\", args: [email] });\n```\n\n`batch` runs many statements **atomically in one transaction** — all commit or all roll back.\n\n```ts\n\u002F\u002F mode: \"write\" (default), \"read\", or \"deferred\"\nconst rs = await db.batch(\n  [\n    { sql: \"INSERT INTO orders (user_id, total) VALUES (?, ?)\", args: [userId, total] },\n    { sql: \"UPDATE users SET order_count = order_count + 1 WHERE id = ?\", args: [userId] },\n  ],\n  \"write\",\n);\n```\n\nSingle-writer rule: SQLite allows exactly one writer at a time. Under concurrent writes you get\n`SQLITE_BUSY` \u002F \"database is locked\". The fix is WAL + `busy_timeout` above, plus keeping write\ntransactions short. If you genuinely need many simultaneous writers, that is the signal to route to\n`postgresdb` — do not paper over it with retries forever.\n\n## Embedded replica sync\n\nA replica keeps a local copy of the data and pulls changes from the primary. Reads hit the local\nfile; writes are sent to the primary and propagate back on the next sync.\n\n- **Periodic**: pass `syncInterval` (seconds) to `createClient` and the client syncs in the background.\n- **On-demand**: call `await db.sync()` yourself — it returns `{ frame_no, frames_synced }` (the\n  replication frame you are now at, and how many frames this call pulled).\n- `readYourWrites` (default `true`) guarantees a connection sees its own writes immediately. Set it\n  to `false` only when you specifically want a sync's effect to become observable on its own timeline.\n- **Gotcha**: calling `db.sync()` on a remote-only or pure HTTP\u002FWS client throws `LibsqlError` with\n  code `SYNC_NOT_SUPPORTED`. Only embedded-replica clients (those with a local `file:` + `syncUrl`)\n  can sync.\n\nDeeper material — sync internals, frame numbers, `readYourWrites` semantics, offline\u002Fbidirectional\nwrites, per-tenant database-per-user patterns, stale-read handling — lives in\n[references\u002Fembedded-replicas.md](references\u002Fembedded-replicas.md).\n\n## libSQL today vs Turso Database (Rust) tomorrow\n\nTwo things wear the \"Turso\" name; do not confuse them.\n\n- **libSQL** is the SQLite fork and the battle-tested foundation. For production today, **use\n  libSQL** via `@libsql\u002Fclient`. This is the official guidance — mission-critical workloads run here.\n- **Turso Database** is a from-scratch rewrite of SQLite in Rust (formerly \"Limbo\"), adding MVCC\n  concurrent writes and bidirectional offline sync. It is the future direction and where new features\n  land, but it is not the default production target yet.\n\nSeparately: **\"edge replicas\" are being discontinued for new users** (data showed ~70% never used\nthem), along with multi-DB schemas and `ATTACH`. Existing paid customers keep them. This is **not**\nthe same as embedded replicas — embedded replicas remain the flagship. Do not design a new account\naround edge replicas.\n\nTurso\u002FlibSQL also has native vector search (DiskANN). For a dedicated vector store, route to\n`vector-db` regardless.\n\n## Operate — the `turso` CLI\n\n```bash\nturso db create my-app                          # create a database\nturso db show my-app --url                       # get the libsql:\u002F\u002F URL for TURSO_DATABASE_URL\nturso db tokens create my-app                    # mint an auth token for TURSO_AUTH_TOKEN\nturso db shell my-app                            # interactive SQL shell against the primary\n```\n\nPricing note: the free tier offers **unlimited databases** (post \"Database Freedom Day\", mid-2025),\nusage-based with generous read\u002Fstorage allowances — exact GB and row-read numbers shift, so verify on\nturso.tech\u002Fpricing before quoting a figure. This is what makes database-per-user economical.\n\nRoute out: backups\u002Frestore strategy → `backups`; versioned migrations → `db-migrations`; type-safe\nschema and queries → `drizzle-orm`; generic SQL authoring (window functions, tuning) → `sql`.\n\n## Anti-patterns\n\n| Anti-pattern | Why it bites | Do instead |\n|---|---|---|\n| Treating SQLite like multi-writer Postgres | One writer at a time → `SQLITE_BUSY` storms under load | Keep writes serial + short, or route to `postgresdb` |\n| Forgetting `PRAGMA journal_mode=WAL` | Default journal blocks readers during every write | Set WAL on local file \u002F replica connections |\n| Embedded replica with a `libsql:\u002F\u002F` url | Not a replica — a confused remote client; reads aren't local | `url:` is a local `file:`, remote goes in `syncUrl` |\n| Hardcoding the auth token in source | Leaks a credential into VCS | Read `process.env.TURSO_AUTH_TOKEN` |\n| Calling `db.sync()` on a remote\u002FHTTP client | Throws `LibsqlError` `SYNC_NOT_SUPPORTED` | Only sync embedded-replica clients |\n| Assuming FK constraints are enforced | `foreign_keys` is OFF by default, per-connection | `PRAGMA foreign_keys=ON` on every connection |\n| Designing a new account around edge replicas | Discontinued for new users | Use embedded replicas (the flagship) |\n| String-concatenated SQL | Injection + no statement caching | Parameterize with `?` \u002F `$name` \u002F tuple args |\n| Reaching for Turso for OLAP dashboards | Row-store, single writer — wrong shape | Use `duckdb` for columnar analytics |\n| Layering migrations\u002FORM logic into this skill | Out of scope; duplicates sibling rigor | `db-migrations` \u002F `drizzle-orm` |\n\n## Verify\n\nWhen you emit a connection\u002Fconfig file, gate it:\n\n```bash\nbash scripts\u002Fverify.sh path\u002Fto\u002Fdb.ts        # or a directory; defaults to cwd\n```\n\nIt statically checks (no network): `@libsql\u002Fclient` import + `createClient` use; that a `syncUrl`\nalways sits next to a local `file:` url; no hardcoded token literal; and (advisory) WAL pragma\npresence on file-backed clients. Read-only; exits 0 on a clean\u002Fempty target.\n","# SQLite & Turso\u002FlibSQL — decide, connect, operate\n\nSQLite is an in-process, single-file, **single-writer** relational engine. Turso\u002FlibSQL is the\nfork that adds a remote edge database and — the part people actually want — **embedded replicas**:\na local SQLite file that syncs to a remote primary, so reads are microsecond-local and writes still\nland durably in the cloud.\n\nThis skill is **decide + connect + operate**. It owns the engine truths (WAL, single writer,\npragmas), the three deployment shapes, and wiring the current `@libsql\u002Fclient`. It does NOT own\nschema modeling or type-safe queries (that is `drizzle-orm`), versioned migration files (that is\n`db-migrations`), or backup strategy as a primary task (that is `backups`).\n\n## Is SQLite\u002FTurso the right tool?\n\nDecide first. Picking SQLite for a high-write multi-writer workload is the mistake that wastes a week.\n\n| Workload | Verdict | Why \u002F route |\n|---|---|---|\n| Read-heavy, single-tenant, low-to-moderate writes | **SQLite\u002FTurso** | One writer is plenty; reads are local and fast. |\n| Local-first \u002F offline \u002F edge app needing cloud durability | **Turso embedded replica** | Local file for reads, syncs to a remote primary. |\n| Database-per-user \u002F per-tenant at scale | **Turso** | Unlimited databases on the free tier; cheap isolation. |\n| Many concurrent writers, complex roles, extensions | No → `postgresdb` (or `mysql`) | SQLite serializes writers; one writer at a time. |\n| Serverless Postgres with branching | No → `neon` | Turso is serverless *SQLite*, not Postgres. |\n| MySQL-compatible serverless | No → `planetscale` | Different engine and protocol. |\n| Auth + realtime + storage + Postgres bundled | No → `supabase` | You want a BaaS, not a raw SQL engine. |\n| Columnar OLAP \u002F analytical aggregates | No → `duckdb` | SQLite\u002FTurso is OLTP, row-oriented. |\n| Ephemeral cache \u002F KV | No → `redis` | Not a durable relational store. |\n\n## Three deployment shapes\n\nEvery Turso\u002FlibSQL decision reduces to which of these three you are wiring. The URL scheme picks the\ntransport automatically.\n\n| Shape | `createClient` config | Latency | When |\n|---|---|---|---|\n| **Local file** | `url: \"file:local.db\"` | In-process | Dev, CLI tools, single-node app, tests. |\n| **Remote edge DB** | `url: \"libsql:\u002F\u002F\u003Cdb>.turso.io\"` + `authToken` | Network round-trip | Serverless\u002Fstateless functions; no local disk to sync. |\n| **Embedded replica** | `url: \"file:local.db\"` + `syncUrl` + `authToken` | Microsecond reads | Local-first\u002Fedge with cloud durability — the flagship. |\n\n`libsql:\u002F\u002F` resolves to HTTPS\u002FWSS. `file:` is native. `https:`\u002F`http:` is Hrana HTTP, `wss:`\u002F`ws:`\nis Hrana WebSocket. You rarely set the scheme by hand — you set the URL and the client chooses.\n\n## Connect with `@libsql\u002Fclient`\n\nCurrent client is **`@libsql\u002Fclient` v0.17.x**. Never hardcode the auth token — read it from the\nenvironment. Convention: `TURSO_DATABASE_URL` and `TURSO_AUTH_TOKEN`.\n\n```ts\n\u002F\u002F 1. Local file — dev, tests, single node\nimport { createClient } from \"@libsql\u002Fclient\";\n\nconst db = createClient({ url: \"file:local.db\" });\n```\n\n```ts\n\u002F\u002F 2. Remote edge DB — serverless, no local disk\nimport { createClient } from \"@libsql\u002Fclient\";\n\nconst db = createClient({\n  url: process.env.TURSO_DATABASE_URL!,   \u002F\u002F libsql:\u002F\u002F\u003Cdb>.turso.io\n  authToken: process.env.TURSO_AUTH_TOKEN!,\n});\n```\n\n```ts\n\u002F\u002F 3. Embedded replica — local reads, syncs to the primary\nimport { createClient } from \"@libsql\u002Fclient\";\n\nconst db = createClient({\n  url: \"file:local.db\",                   \u002F\u002F MUST be a local file\n  syncUrl: process.env.TURSO_DATABASE_URL!,\n  authToken: process.env.TURSO_AUTH_TOKEN!,\n  syncInterval: 60,                        \u002F\u002F seconds; or call db.sync() manually\n});\n```\n\nRule: an embedded replica's `url` is **always** a local `file:` — `syncUrl` is the remote. If you\nset `syncUrl` next to a `libsql:\u002F\u002F` url you have not built a replica, you have a confused remote\nclient. (verify.sh enforces exactly this.)\n\nIn serverless\u002Fedge runtimes the import is the same; just confirm the runtime exposes a writable temp\npath for the `file:` replica, or fall back to shape #2 (remote-only).\n\n## WAL and the pragmas you must set\n\nFor any **local file** or **embedded replica** connection, set these per-connection on open. They do\nnot apply to a remote-only client (the primary already runs WAL server-side).\n\n```sql\nPRAGMA journal_mode = WAL;     -- concurrent readers + one writer; default rollback-journal blocks readers during writes\nPRAGMA busy_timeout = 5000;    -- wait up to 5s for the write lock instead of erroring SQLITE_BUSY immediately\nPRAGMA foreign_keys = ON;      -- FK enforcement is OFF by default and is PER-CONNECTION — set it every time\nPRAGMA synchronous = NORMAL;   -- safe with WAL; far fewer fsyncs than the default FULL\n```\n\n`journal_mode` is persistent once set on the file; `busy_timeout`, `foreign_keys`, and `synchronous`\nare per-connection — re-issue them on every new connection (and in pooled environments, on checkout).\n\n## Writes, batches, transactions\n\nAlways parameterize. String-concatenated SQL is an injection hole and defeats statement caching.\n\n```ts\n\u002F\u002F Bad — string interpolation\nawait db.execute(`INSERT INTO users (email) VALUES ('${email}')`);\n\n\u002F\u002F Good — positional ? args (named $name and tuple [sql, args] forms also work)\nawait db.execute({ sql: \"INSERT INTO users (email) VALUES (?)\", args: [email] });\n```\n\n`batch` runs many statements **atomically in one transaction** — all commit or all roll back.\n\n```ts\n\u002F\u002F mode: \"write\" (default), \"read\", or \"deferred\"\nconst rs = await db.batch(\n  [\n    { sql: \"INSERT INTO orders (user_id, total) VALUES (?, ?)\", args: [userId, total] },\n    { sql: \"UPDATE users SET order_count = order_count + 1 WHERE id = ?\", args: [userId] },\n  ],\n  \"write\",\n);\n```\n\nSingle-writer rule: SQLite allows exactly one writer at a time. Under concurrent writes you get\n`SQLITE_BUSY` \u002F \"database is locked\". The fix is WAL + `busy_timeout` above, plus keeping write\ntransactions short. If you genuinely need many simultaneous writers, that is the signal to route to\n`postgresdb` — do not paper over it with retries forever.\n\n## Embedded replica sync\n\nA replica keeps a local copy of the data and pulls changes from the primary. Reads hit the local\nfile; writes are sent to the primary and propagate back on the next sync.\n\n- **Periodic**: pass `syncInterval` (seconds) to `createClient` and the client syncs in the background.\n- **On-demand**: call `await db.sync()` yourself — it returns `{ frame_no, frames_synced }` (the\n  replication frame you are now at, and how many frames this call pulled).\n- `readYourWrites` (default `true`) guarantees a connection sees its own writes immediately. Set it\n  to `false` only when you specifically want a sync's effect to become observable on its own timeline.\n- **Gotcha**: calling `db.sync()` on a remote-only or pure HTTP\u002FWS client throws `LibsqlError` with\n  code `SYNC_NOT_SUPPORTED`. Only embedded-replica clients (those with a local `file:` + `syncUrl`)\n  can sync.\n\nDeeper material — sync internals, frame numbers, `readYourWrites` semantics, offline\u002Fbidirectional\nwrites, per-tenant database-per-user patterns, stale-read handling — lives in\n[references\u002Fembedded-replicas.md](references\u002Fembedded-replicas.md).\n\n## libSQL today vs Turso Database (Rust) tomorrow\n\nTwo things wear the \"Turso\" name; do not confuse them.\n\n- **libSQL** is the SQLite fork and the battle-tested foundation. For production today, **use\n  libSQL** via `@libsql\u002Fclient`. This is the official guidance — mission-critical workloads run here.\n- **Turso Database** is a from-scratch rewrite of SQLite in Rust (formerly \"Limbo\"), adding MVCC\n  concurrent writes and bidirectional offline sync. It is the future direction and where new features\n  land, but it is not the default production target yet.\n\nSeparately: **\"edge replicas\" are being discontinued for new users** (data showed ~70% never used\nthem), along with multi-DB schemas and `ATTACH`. Existing paid customers keep them. This is **not**\nthe same as embedded replicas — embedded replicas remain the flagship. Do not design a new account\naround edge replicas.\n\nTurso\u002FlibSQL also has native vector search (DiskANN). For a dedicated vector store, route to\n`vector-db` regardless.\n\n## Operate — the `turso` CLI\n\n```bash\nturso db create my-app                          # create a database\nturso db show my-app --url                       # get the libsql:\u002F\u002F URL for TURSO_DATABASE_URL\nturso db tokens create my-app                    # mint an auth token for TURSO_AUTH_TOKEN\nturso db shell my-app                            # interactive SQL shell against the primary\n```\n\nPricing note: the free tier offers **unlimited databases** (post \"Database Freedom Day\", mid-2025),\nusage-based with generous read\u002Fstorage allowances — exact GB and row-read numbers shift, so verify on\nturso.tech\u002Fpricing before quoting a figure. This is what makes database-per-user economical.\n\nRoute out: backups\u002Frestore strategy → `backups`; versioned migrations → `db-migrations`; type-safe\nschema and queries → `drizzle-orm`; generic SQL authoring (window functions, tuning) → `sql`.\n\n## Anti-patterns\n\n| Anti-pattern | Why it bites | Do instead |\n|---|---|---|\n| Treating SQLite like multi-writer Postgres | One writer at a time → `SQLITE_BUSY` storms under load | Keep writes serial + short, or route to `postgresdb` |\n| Forgetting `PRAGMA journal_mode=WAL` | Default journal blocks readers during every write | Set WAL on local file \u002F replica connections |\n| Embedded replica with a `libsql:\u002F\u002F` url | Not a replica — a confused remote client; reads aren't local | `url:` is a local `file:`, remote goes in `syncUrl` |\n| Hardcoding the auth token in source | Leaks a credential into VCS | Read `process.env.TURSO_AUTH_TOKEN` |\n| Calling `db.sync()` on a remote\u002FHTTP client | Throws `LibsqlError` `SYNC_NOT_SUPPORTED` | Only sync embedded-replica clients |\n| Assuming FK constraints are enforced | `foreign_keys` is OFF by default, per-connection | `PRAGMA foreign_keys=ON` on every connection |\n| Designing a new account around edge replicas | Discontinued for new users | Use embedded replicas (the flagship) |\n| String-concatenated SQL | Injection + no statement caching | Parameterize with `?` \u002F `$name` \u002F tuple args |\n| Reaching for Turso for OLAP dashboards | Row-store, single writer — wrong shape | Use `duckdb` for columnar analytics |\n| Layering migrations\u002FORM logic into this skill | Out of scope; duplicates sibling rigor | `db-migrations` \u002F `drizzle-orm` |\n\n## Verify\n\nWhen you emit a connection\u002Fconfig file, gate it:\n\n```bash\nbash scripts\u002Fverify.sh path\u002Fto\u002Fdb.ts        # or a directory; defaults to cwd\n```\n\nIt statically checks (no network): `@libsql\u002Fclient` import + `createClient` use; that a `syncUrl`\nalways sits next to a local `file:` url; no hardcoded token literal; and (advisory) WAL pragma\npresence on file-backed clients. Read-only; exits 0 on a clean\u002Fempty target.\n",{"name":5,"tags":24,"origin":32,"recommends":33,"description":7},[25,26,27,28,29,30,31],"sqlite","turso","libsql","edge","embedded-replica","local-first","wal","risco",[34,35,36,37,38,39],"drizzle-orm","db-migrations","postgresdb","neon","backups","sql","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Fsqlite-turso",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill sqlite-turso",{"tool":54,"command":55},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill sqlite-turso",{"tool":57,"command":58},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill sqlite-turso","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fsqlite-turso\u002FSKILL.md",true,[62,68,72],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"evals\u002Fcases.yaml","REFERENCE","参考文档",4059,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fsqlite-turso\u002Fevals\u002Fcases.yaml",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"evals\u002FREADME.md",1754,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fsqlite-turso\u002Fevals\u002FREADME.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fembedded-replicas.md",5732,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Fsqlite-turso\u002Freferences\u002Fembedded-replicas.md",[77,85,90,97,104,111],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":84},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":86,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":84},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":84},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":84},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":84},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":84},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]