bun-drizzle-integration

仓库创建 2025年11月8日最近提交 29 天前SkillHot 收录 22 天前
▸ 精选理由

适合需要类型安全模型与轻量迁移的 Bun 项目。

▸ 风险提示

涉及数据库迁移与本地数据操作,使用前请备份数据。

这个 Skill 做什么

在 Bun 中使用 Drizzle ORM 与 SQLite 驱动做类型化数据库访问与迁移。

在 Bun 环境里用 Drizzle ORM 配合 SQLite 驱动做类型化的数据库定义和迁移。适合在用 Bun 写后端、想要在 TypeScript 中有安全的 schema 和自动迁移时使用。特别之处是把 Drizzle 的类型安全和 drizzle-kit 的迁移流程带进 Bun,开发和维护数据表更顺手。

▸ 展开 SKILL.md 英文原文

Use when integrating Drizzle ORM with Bun's SQLite driver for type-safe schema definitions and migrations.

开发编程ORM数据库SQLite通用
180
Stars
28
Forks
40
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/secondsky/claude-skills/main/plugins/bun/skills/bun-drizzle-integration/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/secondsky/claude-skills/main/plugins/bun/skills/bun-drizzle-integration/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Bun Drizzle Integration

Drizzle ORM provides type-safe database access with Bun's SQLite driver.

## Quick Start

```bash
bun add drizzle-orm
bun add -D drizzle-kit
```

## Schema Definition

```typescript
// 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: te
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有