better-sqlite3

better-sqlite3 is a skill for Claude Code, Codex from ashish7802/awesome-api-skills. It costs 0 tokens per session (246 once invoked), scanned A, original, MIT.

A practical guide to using better-sqlite3, a Node.js library that lets JavaScript programs store data in SQLite, a small file-based database. It covers installation, common mistakes, and production setup checks.

In plain words
What is it for?
Use it when adding SQLite storage to a Node.js application, especially for installing the library, writing transactions, enabling write-ahead logging, and checking foreign-key and bulk-insert settings.
Why use it?
It helps prevent errors caused by treating its synchronous database calls as asynchronous, using asynchronous transaction functions, or missing important SQLite settings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding SQLite storage to a Node.js application, especially for installing the library, writing transactions, enabling write-ahead logging, and checking foreign-key and bulk-insert settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashish7802/awesome-api-skills/better-sqlite3
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashish7802/awesome-api-skills --skill better-sqlite3
Clone the repo
git clone --depth 1 https://github.com/ashish7802/awesome-api-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for better-sqlite3

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/better-sqlite3/github.svg)](https://agentmods.dev/skills/ashish7802/awesome-api-skills/better-sqlite3)
Your own site
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/better-sqlite3"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/better-sqlite3/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for better-sqlite3

Your own site · 80×15
<a href="https://agentmods.dev/skills/ashish7802/awesome-api-skills/better-sqlite3"><img src="https://agentmods.dev/badge/skills/ashish7802/awesome-api-skills/better-sqlite3.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 246 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00246
Opus 5.5 $0.00000 $0.00098
Sonnet 5.5 $0.00000 $0.00049
Haiku 4.5 $0.00000 $0.00025

Measured yesterday against content hash 888d9b997cab, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

better-sqlite3 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (examples/sqlite-wal.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/better-sqlite3/SKILL.md · 24 lines

What it actually says

better-sqlite3 Skill

Overview

better-sqlite3 provides a high-speed synchronous C++ binding for SQLite in Node.js, outperforming asynchronous drivers by eliminating mutex locking and event-loop roundtrips.

Installation

npm install better-sqlite3
npm install -D @types/better-sqlite3

AI Pitfalls

  • Synchronous API: Never await stmt.get(), stmt.all(), or stmt.run(). They return results synchronously.
  • No async in db.transaction(): db.transaction(fn) immediately commits or rolls back when fn returns. Passing an async function causes the transaction to commit before the Promise resolves!
  • Enable WAL Mode: Always run db.pragma('journal_mode = WAL') immediately upon database initialization.

Production Checklist

  • db.pragma('journal_mode = WAL') enabled
  • db.pragma('foreign_keys = ON') enabled
  • Bulk inserts wrapped in db.transaction()

Last Verified: 2026-10-21

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 24 lines · 0 tokens per session scan A 888d9b997cab

Subscribe to this mod's changes

better-sqlite3 is a skill published in the GitHub repository ashish7802/awesome-api-skills (13 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 246 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-22.

Related

Other skills, from other repositories

chdb-datastore

Skill "chdb-datastore" from ItamarZand88/awesome-agent-conventions, covering chdb datastore — it's just faster pandas, the key insight, change this, to this and everything else stays the same.

ItamarZand88/awesome-agent-conventions · 0 tokens

posit-ggsql

Skill "posit-ggsql" from ItamarZand88/awesome-agent-conventions, covering ggsql query writer, query structure, pattern a: select → visualise, pattern b: visualise from and data sources.

ItamarZand88/awesome-agent-conventions · 0 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens

azure-resource-manager-sql-dotnet

Azure Resource Manager SDK for Azure SQL in .NET. Use for MANAGEMENT PLANE operations: creating/managing SQL servers, databases, elastic pools, firewall rules, and failover groups via Azure Resource Manager. NOT for data plane operations (executing queries) - use Microsoft.Data.SqlClient for that. Triggers: "SQL…

microsoft/skills · 109 tokens

azure-data-tables-java

Build table storage applications with Azure Tables SDK for Java. Use when working with Azure Table Storage or Cosmos DB Table API for NoSQL key-value data, schemaless storage, or structured data at scale.

microsoft/skills · 47 tokens