Use SQLite correctly with proper concurrency, pragmas, and type handling.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install sqlite或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install sqlite⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/sqlite/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: SQLite description: Use SQLite correctly with proper concurrency, pragmas, and type handling. metadata: {"clawdbot":{"emoji":"🪶","requires":{"bins":["sqlite3"]},"os":["linux","darwin","win32"]}} ---
PRAGMA journal_mode=WAL—allows reads during writes, huge improvementPRAGMA busy_timeout=5000—waits 5s before SQLITE_BUSY instead of failing immediately-wal and -shm files—don't forget to copy them with main databaseBEGIN IMMEDIATE to grab write lock early—prevents deadlocks in read-then-write patternsPRAGMA foreign_keys=ON required per connection—not persisted in databasePRAGMA foreign_keys returns 0 or 1STRICT tables enforce types—but only SQLite 3.37+ (2021)ALTER TABLE very limited—can add column, rename table/column; that's mostly itALTER TABLE ADD COLUMN can't have PRIMARY KEY, UNIQUE, or NOT NULL without defaultPRAGMA optimize before closing long-running connections—updates query planner statsPRAGMA cache_size=-64000 for 64MB cache—negative = KB; default very smallPRAGMA synchronous=NORMAL with WAL—good balance of safety and speedPRAGMA temp_store=MEMORY for temp tables in RAM—faster sorts and temp resultsVACUUM rewrites entire database, reclaims spaceVACUUM needs 2x disk space temporarily—ensure enough roomPRAGMA auto_vacuum=INCREMENTAL with PRAGMA incremental_vacuum—partial reclaim without full rewrite.backup command in sqlite3—or sqlite3_backup_* API-wal and -shm must be copied atomically with main fileVACUUM INTO 'backup.db' creates standalone copy (3.27+)CREATE INDEX ... WHERE conditionCREATE INDEX ON t(lower(name))EXPLAIN QUERY PLAN shows index usage—simpler than PostgreSQL EXPLAINBEGIN; INSERT...; INSERT...; COMMIT—10-100x fasterBEGIN EXCLUSIVE for exclusive lock—blocks all other connectionsSAVEPOINT name / RELEASE name / ROLLBACK TO nameVACUUM can change ROWIDs; use explicit INTEGER PRIMARY KEY':memory:'—each connection gets different database; use file::memory:?cache=shared for shared安装 SQLite 后,可以对 AI 说这些话来触发它
Help me get started with SQLite
Explains what SQLite does, walks through the setup, and runs a quick demo based on your current project
Use SQLite to use SQLite correctly with proper concurrency, pragmas, and type han...
Invokes SQLite with the right parameters and returns the result directly in the conversation
What can I do with SQLite in my data & analytics workflow?
Lists the top use cases for SQLite, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/sqlite/ 目录(个人级,所有项目可用),或 .claude/skills/sqlite/(项目级)。重启 AI 客户端后,用 /sqlite 主动调用,或让 AI 根据上下文自动发现并使用。
SQLite 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
SQLite 可免费安装使用。请查阅仓库了解许可证信息。
Use SQLite correctly with proper concurrency, pragmas, and type handling.
SQLite 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my data & analytics tasks using SQLite
Identifies repetitive steps in your workflow and sets up SQLite to handle them automatically