bun-sqlite
SolidUse for bun:sqlite, SQLite operations, prepared statements, transactions, and queries.
API & Backend 168 stars
27 forks Updated 4 weeks ago MIT
Install
Quality Score: 89/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Bun SQLite
Bun has a built-in, high-performance SQLite driver via `bun:sqlite`.
## Quick Start
```typescript
import { Database } from "bun:sqlite";
// Create/open database
const db = new Database("mydb.sqlite");
// Create table
db.run(`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE
)
`);
// Insert data
db.run("INSERT INTO users (name, email) VALUES (?, ?)", ["Alice", "alice@example.com"]);
// Query data
const users = db.query("SELECT * FROM users").all();
console.log(users);
// Close
db.close();
```
## Opening Databases
```typescript
import { Database } from "bun:sqlite";
// File-based database
const db = new Database("data.sqlite");
// In-memory database
const memDb = new Database(":memory:");
// Read-only mode
const readDb = new Database("data.sqlite", { readonly: true });
// Create if not exists (default)
const createDb = new Database("new.sqlite", { create: true });
// Strict mode (recommended)
const strictDb = new Database("strict.sqlite", { strict: true });
```
## Running Queries
### Direct Execution
```typescript
// Run (for INSERT, UPDATE, DELETE, DDL)
db.run("CREATE TABLE items (id INTEGER PRIMARY KEY, name TEXT)");
db.run("INSERT INTO items (name) VALUES (?)", ["Item 1"]);
db.run("DELETE FROM items WHERE id = ?", [1]);
// Get changes info
const result = db.run("DELETE FROM items WHERE id > ?", [10]);
console.log(result.changes); // Rows affected
console.log(result.l...
Details
- Author
- secondsky
- Repository
- secondsky/claude-skills
- Created
- 7 months ago
- Last Updated
- 4 weeks ago
- Language
- TypeScript
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
bun
Bun runtime: build fast Node.js-compatible APIs with Bun's built-in server, bundler, test runner, and package manager — Elysia framework, SQLite, and edge-optimised patterns
4 Updated 2 days ago
Claudient AI & Automation Listed
bun
Build fast applications with Bun JavaScript runtime. Use when creating Bun projects, using Bun APIs, bundling, testing, or optimizing Node.js alternatives. Triggers on Bun, Bun runtime, bun.sh, bunx, Bun serve, Bun test, JavaScript runtime.
2 Updated today
Makiya1202 DevOps & Infrastructure Listed
bun-runtime
Bun runtime management, scripting, package management, and server deployment.
0 Updated 2 months ago
UltraXn