Bun + Hono + SQLite (libSQL & Drizzle ORM)
Ultra-fast edge API architecture using Bun.serve(), Hono v4, Drizzle ORM with embedded SQLite / Turso libSQL, and Zod OpenAPI validation.
- Formats
- 4 files
- AGENTS.md
- 42 lines
- CLAUDE.md
- 16 lines
- Languages
- TypeScript
- Updated
- Sep 2026
- Used by
- 4 projects
Writes .claude/skills/bun-hono-sqlite/SKILL.md
$ curl -s --create-dirs -o .claude/skills/bun-hono-sqlite/SKILL.md https://stackitfast.com/rules/bun-hono-sqlite/SKILL.mdRule files
Works with Cursor · Claude Code · Windsurf · AGY
Architecture notes
Architecture Overview
Production-ready architectural guidelines for Bun, Hono v4, SQLite, and Drizzle ORM.
Key Advantages
- Sub-Millisecond Response Times: Bun’s native C/Zig bindings combined with Hono’s lightweight RegExpRouter deliver microsecond latency overhead.
- Embedded & Edge Ready: Zero-configuration embedded SQLite via
bun:sqliteor distributed edge replication via Turso libSQL. - End-to-End Type Safety: Hono RPC allows sharing backend route types directly with frontend clients without code generation.
Frequently asked questions
Why use bun:sqlite instead of better-sqlite3 or node:sqlite?
bun:sqlite is a native binding built into the Bun runtime with no native compilation step, and it benchmarks faster than better-sqlite3 for most workloads. It shares the same synchronous API shape, so swapping in Turso's @libsql/client for edge replication later requires minimal code changes.
Does this AGENTS.md work with Cursor, Claude Code, and Windsurf?
Yes — AGENTS.md is the open, cross-tool standard supported by 30+ coding agents including Cursor, Claude Code, and Windsurf. A dedicated .mdc file is also provided for Cursor's native .cursor/rules format.
Why does WAL mode matter for a Bun + SQLite API?
Write-Ahead Logging lets readers and a single writer operate concurrently instead of locking the whole database file, which matters under Bun's high request throughput. Without WAL, concurrent requests hitting SQLite will serialize and can produce SQLITE_BUSY errors under load.
Used in production
Explore all stacksGotify
6Gotify keeps the server one deployable Go binary by embedding its Vite/React web UI, using Gin and gorilla/websocket for the REST and streaming API, and swapping SQLite, MySQL or PostgreSQL through GORM, while a compiled Go plugin system handles extensibility instead of a scripting layer.
elekcsv
5Keeping parsing, compiled-validator generation, fuzzy column mapping and bitmap error tracking in one dependency-free core package lets every UI framework reuse identical import logic instead of six separate implementations.
Orca
1Agent CLIs stay the user's own. Orca adds the orchestration layer around them: isolated git worktrees, a PTY daemon that outlives the UI, and a relay for mobile steering. It can support new agents without bundling them.
MindsHub (formerly MindsDB)
1Splitting the client, API and agent into separately versioned git submodules lets each ship on its own cadence (a signed desktop app, a PyPI server package, an agent package), while one Makefile and one docker-compose.yml still bring the whole stack up together.