
Bun Drizzle Integration
This drops Drizzle ORM into Bun projects with SQLite, giving you type-safe queries without writing raw SQL. The setup is minimal: add the packages, define your schema in TypeScript, run migrations with drizzle-kit. What's nice is the relational query API that lets you pull nested data without manual joins, and the prepare() method for reusing statements in tight loops. It includes practical examples of upserts, transactions, and the json column mode for SQLite. If you're already on Bun and want an ORM that feels like TypeScript instead of fighting it, this covers the integration patterns and CRUD operations you'll actually use.
- skills.sh installs
- 353
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill bun-drizzle-integration --agent claude-codeInstalls into .claude/skills of the current project.
Files
Bun Drizzle Integration
Drizzle ORM provides type-safe database access with Bun's SQLite driver.
Quick Start
bun add drizzle-orm
bun add -D drizzle-kit
Schema Definition
// src/db/schema.ts
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
export const users = sqliteTable("users", {
id: integer("id").primaryKey({ autoIncrement: true }),
name: text("name").notNull(),
email: text("email").notNull().unique(),
createdAt: integer("created_at", { mode: "timestamp" })
.notNull()
.default(sql`(unixepoch())`),
});
export const posts = sqliteTable("posts", {
id: integer("id").primaryKey({ autoIncrement: true }),
title: text("title").notNull(),
content: text("content"),
authorId: integer("author_id")
.notNull()
.references(() => users.id),
});
Database Setup
// src/db/index.ts
import { drizzle } from "drizzle-orm/bun-sqlite";
import { Database } from "bun:sqlite";
import * as schema from "./schema";
const sqlite = new Database("app.db");
export const db = drizzle(sqlite, { schema });
Configuration
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, Databases
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Bun Docker343
- Bun Runtime342
- Cloudflare Workers Testing340
- Bun Cloudflare Workers338
- Bun Test Coverage337
- Bun Http Server336
- Bun Test Mocking335
- Nuxt Seo335
- Bun Bundler334
- Bun Workers333
- Bun Shell331
- Bun React Ssr330
- Bun Tanstack Start329
- Cloudflare Workers Performance329
- Bun Hot Reloading328
- Bun Redis328
- Bun Ffi326
- Bun Jest Migration326
- Bun Websocket Server326
- Cloudflare Workers Runtime Apis326
- Swift Best Practices326
- Bun Nuxt323
- Bun Macros322
- Cloudflare Workers Frameworks321