Token导航 LogoToken导航TokenDH.com
效率需要联网clawhub未标认证来源可访问clear审计通过

sqlitesqlite 分析

Agent Skill

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

总安装

168,480

周安装

7,020

GitHub Stars

6

下载量

56,160
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sqlite(sqlite 分析)
来源仓库:https://github.com/ivangdavila/sqlite
安装命令:
openclaw skills install sqlite
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install sqlite

简介

sqlite 指导正确使用 SQLite 并发控制、编译指示和类型处理。

  • 适用于轻量级桌面、移动端或嵌入式系统中的数据存储方案。
  • 优化索引策略与查询写法,提升读取性能。
  • 安装命令:openclaw skills install sqlite;需数据库文件路径和读写权限。
  • 写入操作建议使用事务包裹,防止部分失败导致数据不一致。

SKILL.md

name
SQLite
description
Use SQLite correctly with proper concurrency, pragmas, and type handling.
metadata
{"clawdbot":{"emoji":"🪶","requires":{"bins":["sqlite3"]},"os":["linux","darwin","win32"]}}

Concurrency (Biggest Gotcha)

  • Only one writer at a time—concurrent writes queue or fail; not for high-write workloads
  • Enable WAL mode: PRAGMA journal_mode=WAL—allows reads during writes, huge improvement
  • Set busy timeout: PRAGMA busy_timeout=5000—waits 5s before SQLITE_BUSY instead of failing immediately
  • WAL needs -wal and -shm files—don't forget to copy them with main database
  • BEGIN IMMEDIATE to grab write lock early—prevents deadlocks in read-then-write patterns

Foreign Keys (Off by Default!)

  • PRAGMA foreign_keys=ON required per connection—not persisted in database
  • Without it, foreign key constraints silently ignored—data integrity broken
  • Check before relying: PRAGMA foreign_keys returns 0 or 1
  • ON DELETE CASCADE only works if foreign_keys is ON

Type System

  • Type affinity, not strict types—INTEGER column accepts "hello" without error
  • STRICT tables enforce types—but only SQLite 3.37+ (2021)
  • No native DATE/TIME—use TEXT as ISO8601 or INTEGER as Unix timestamp
  • BOOLEAN doesn't exist—use INTEGER 0/1; TRUE/FALSE are just aliases
  • REAL is 8-byte float—same precision issues as any float

Schema Changes

  • ALTER TABLE very limited—can add column, rename table/column; that's mostly it
  • Can't change column type, add constraints, or drop columns (until 3.35)
  • Workaround: create new table, copy data, drop old, rename—wrap in transaction
  • ALTER TABLE ADD COLUMN can't have PRIMARY KEY, UNIQUE, or NOT NULL without default

Performance Pragmas

  • PRAGMA optimize before closing long-running connections—updates query planner stats
  • PRAGMA cache_size=-64000 for 64MB cache—negative = KB; default very small
  • PRAGMA synchronous=NORMAL with WAL—good balance of safety and speed
  • PRAGMA temp_store=MEMORY for temp tables in RAM—faster sorts and temp results

Vacuum & Maintenance

  • Deleted data doesn't shrink file—VACUUM rewrites entire database, reclaims space
  • VACUUM needs 2x disk space temporarily—ensure enough room
  • PRAGMA auto_vacuum=INCREMENTAL with PRAGMA incremental_vacuum—partial reclaim without full rewrite
  • After bulk deletes, always vacuum or file stays bloated

Backup Safety

  • Never copy database file while open—corrupts if write in progress
  • Use .backup command in sqlite3—or sqlite3_backup_* API
  • WAL mode: -wal and -shm must be copied atomically with main file
  • VACUUM INTO 'backup.db' creates standalone copy (3.27+)

Indexing

  • Covering indexes work—add extra columns to avoid table lookup
  • Partial indexes supported (3.8+): CREATE INDEX ... WHERE condition
  • Expression indexes (3.9+): CREATE INDEX ON t(lower(name))
  • EXPLAIN QUERY PLAN shows index usage—simpler than PostgreSQL EXPLAIN

Transactions

  • Autocommit by default—each statement is own transaction; slow for bulk inserts
  • Batch inserts: BEGIN; INSERT...; INSERT...; COMMIT—10-100x faster
  • BEGIN EXCLUSIVE for exclusive lock—blocks all other connections
  • Nested transactions via SAVEPOINT name / RELEASE name / ROLLBACK TO name

Common Mistakes

  • Using SQLite for web app with concurrent users—one writer blocks all; use PostgreSQL
  • Assuming ROWID is stable—VACUUM can change ROWIDs; use explicit INTEGER PRIMARY KEY
  • Not setting busy_timeout—random SQLITE_BUSY errors under any concurrency
  • In-memory database ':memory:'—each connection gets different database; use file::memory:?cache=shared for shared

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

72.9%
按下载量换算40,941

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills