sqlite-expert
하는 일
이 스킬은 하나의 파일로 된 내장 데이터베이스인 SQLite를 쓰는 방법을 안내하며, 성능 설정, 트랜잭션, 전문 검색을 포함합니다. 작은 앱, 모바일 앱, 기기, 로컬 캐시를 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓데이터를 하나의 SQLite 파일에 저장하는 작은 앱이나 기기를 만들 때.
- ✓SQLite에서 busy 오류가 나서 더 나은 동시 접근 설정이 필요할 때.
- ✓SQLite 데이터베이스 안에서 전문 검색이 필요할 때.
스킬 링크
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/sqlite-expert/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“작은 메모 앱을 위해 SQLite를 설정해서 읽기와 쓰기가 원활하게 함께 작동하게 하고, 메모 제목과 본문을 검색할 수 있게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 WAL 모드, busy 시간 제한, 짧고 명시적인 트랜잭션, 알맞은 인덱스, 전문 검색을 위한 FTS5 확장을 권장합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
SQLite Expert
A database specialist with deep expertise in SQLite internals, performance tuning, and embedded database patterns. This skill provides guidance for using SQLite effectively in applications ranging from mobile apps and IoT devices to server-side caching layers and analytical workloads, leveraging its advanced features well beyond simple key-value storage.
Key Principles
- Enable WAL mode (PRAGMA journal_mode=WAL) for concurrent read/write access; it allows readers to proceed without blocking writers and vice versa
- Use PRAGMA busy_timeout to set a reasonable wait duration (e.g., 5000ms) instead of receiving SQLITE_BUSY errors immediately on contention
- Design schemas with appropriate indexes from the start; SQLite's query planner relies heavily on index availability for efficient execution plans
- Keep transactions short and explicit; wrap related writes in BEGIN/COMMIT to ensure atomicity and reduce fsync overhead
- Understand that SQLite is serverless and single-file; its strength is simplicity and reliability, not high-concurrency multi-writer workloads
Techniques
- Set performance PRAGMAs at connection open: journal_mode=WAL, synchronous=NORMAL, cache_size=-64000 (64MB), mmap_size=268435456, temp_store=MEMORY
- Use FTS5 for full-text search: CREATE VIRTUAL TABLE docs USING fts5(title, body) with MATCH queries and bm25() ranking
- Query JSON data with the JSON1 extension: json_extract(), json_each(), json_group_array() for document-style data stored in TEXT columns
- Write recursive CTEs (WITH RECURSIVE) for tree traversal, graph walking, and generating series of values
- Use window functions (ROW_NUMBER, LAG, LEAD, SUM OVER) for running totals, rankings, and time-series analysis without self-joins
- Create covering indexes that include all columns needed by a query to enable index-only scans (verified with EXPLAIN QUERY PLAN showing COVERING INDEX)
- Implement UPSERT with INSERT ... ON CONFLICT (column) DO UPDATE SET for atomic insert-or-update operations
Common Patterns
- Multi-database Access: Use ATTACH DATABASE to query across multiple SQLite files in a single connection, joining tables from different databases
- Application-defined Functions: Register custom scalar or aggregate functions in your host language for domain-specific computations inside SQL queries
- Incremental Vacuum: Use PRAGMA auto_vacuum=INCREMENTAL with periodic PRAGMA incremental_vacuum to reclaim space without a full VACUUM lock
- Schema Migration: Use PRAGMA user_version to track schema version and apply migration scripts sequentially on application startup
Pitfalls to Avoid
- Do not open multiple connections with different PRAGMA settings; WAL mode and other PRAGMAs should be set consistently on every connection
- Do not use SQLite for high-concurrency write workloads with dozens of simultaneous writers; consider PostgreSQL or another client-server database instead
- Do not store large BLOBs (over 1MB) inline; SQLite performs better when large objects are stored as external files with paths referenced in the database
- Do not skip EXPLAIN QUERY PLAN during development; without it, slow full-table scans go unnoticed until production load reveals them
자주 묻는 질문
WAL 모드란 무엇인가요?
작성자가 일하는 동안에도 읽기가 계속되게 하는 저널 모드로, 동시 접근에 도움이 됩니다.
SQLite는 쓰기 작업자가 많아도 좋은가요?
스킬은 SQLite가 간단하고 신뢰할 수 있는 단일 파일 저장에 가장 강하며, 고동시성 다중 작성 작업에는 맞지 않다고 말합니다.
busy 시간 제한은 무엇을 하나요?
다른 쓰기가 진행 중일 때 즉시 실패하지 않고 정해진 시간 동안 잠금을 기다리게 합니다.
상세 정보
작성자의 원본 설명
SQLite expert for WAL mode, query optimization, embedded patterns, and advanced features
repo: RightNow-AI/openfang
인기도
- GitHub 스타
- 18k
- 순위
- #10714
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 7. 2.
댓글
- …
이 저장소의 다른 스킬
browser-automation
18k에이전트가 Playwright로 웹 브라우저를 제어하도록 가르칩니다. CSS 선택자로 버튼, 양식, 링크를 찾습니다.
clip-hand-skill
18k에이전트가 영상 클립을 만들도록 돕습니다. 영상을 내려받고, 음성을 텍스트로 옮기고, 자막 파일을 만들고, ffmpeg로 클립을 자릅니다.
collector-hand-skill
18k에이전트가 주제나 회사에 관한 공개 정보를 모으고, 핵심 개체를 뽑고, 변화를 추적하며, 여론을 가늠하도록 돕습니다.
infisical-sync-skill
18k에이전트가 API를 통해 Infisical 금고의 비밀 정보를 읽고 갱신하도록 돕습니다. 로그인 단계와 명확한 오류 처리를 포함합니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.