neon-drizzle

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Neon Drizzle Integration

Neon与Drizzle集成

Comprehensive Drizzle ORM setup for Neon databases with guided workflows.
为Neon数据库提供全面的Drizzle ORM设置流程及引导式工作流。

When to Use This Skill

何时使用此技能

  • Setting up Drizzle in a new project (Next.js, Vite, Express, etc.)
  • Integrating Drizzle into an existing application
  • Creating or modifying database schemas
  • Troubleshooting migration issues
  • 在新项目(Next.js、Vite、Express等)中设置Drizzle
  • 将Drizzle集成到现有应用中
  • 创建或修改数据库模式
  • 排查迁移问题

Code Generation Rules

代码生成规则

When generating TypeScript/JavaScript code:
  • BEFORE generating import statements, check tsconfig.json for path aliases (compilerOptions.paths)
  • If path aliases exist (e.g., "@/": ["./src/"]), use them (e.g., import { x } from '@/lib/utils')
  • If NO path aliases exist or unsure, ALWAYS use relative imports (e.g., import { x } from '../../../lib/utils')
  • Verify imports match the project's configuration
  • Default to relative imports - they always work regardless of configuration
生成TypeScript/JavaScript代码时:
  • 在生成导入语句之前,检查tsconfig.json中的路径别名(compilerOptions.paths)
  • 如果存在路径别名(例如"@/": ["./src/"]),则使用该别名(例如import { x } from '@/lib/utils')
  • 如果不存在路径别名或不确定,始终使用相对导入(例如import { x } from '../../../lib/utils')
  • 验证导入是否与项目配置匹配
  • 默认使用相对导入——无论配置如何,它们始终有效

Available Guides

可用指南

Each guide is a complete, self-contained walkthrough with numbered phases:
  • guides/new-project.md
    - Full setup from scratch (see: Table of Contents)
  • guides/existing-project.md
    - Add Drizzle to running apps (see: Table of Contents)
  • guides/schema-only.md
    - Schema creation and modification (see: Table of Contents)
  • guides/troubleshooting.md
    - Debug common issues (organized by error type)
I'll automatically detect your context (package manager, framework, deployment target) and select the appropriate guide based on your request.
每个指南都是完整的独立分步教程,包含多个阶段:
  • guides/new-project.md
    - 从0到1的完整设置流程(查看:目录)
  • guides/existing-project.md
    - 向运行中的应用添加Drizzle(查看:目录)
  • guides/schema-only.md
    - 数据库模式的创建与修改(查看:目录)
  • guides/troubleshooting.md
    - 调试常见问题(按错误类型分类)
我会自动检测你的项目上下文(包管理器、框架、部署目标),并根据你的请求选择合适的指南。

Quick Examples

快速示例

Tell me what you're building - I'll handle the rest:
  • "Setup Drizzle for my Next.js blog on Vercel" → Auto-detects Vercel + Next.js → HTTP adapter
  • "Add Drizzle to my Express API" → Auto-detects Node.js server → WebSocket adapter
  • "Create a users table with auth fields" → Loads schema guide → Generates schema
告诉我你正在构建的项目,我会处理其余部分:
  • "为我在Vercel上的Next.js博客设置Drizzle" → 自动检测Vercel + Next.js → 使用HTTP适配器
  • "为我的Express API添加Drizzle" → 自动检测Node.js服务器 → 使用WebSocket适配器
  • "创建包含认证字段的用户表" → 加载模式指南 → 生成数据库模式

Reference Documentation

参考文档

For deeper technical details (loaded on-demand):
  • references/adapters.md
    - HTTP vs WebSocket decision guide
  • references/migrations.md
    - Migration patterns and troubleshooting
  • references/query-patterns.md
    - Example queries and best practices
如需更深入的技术细节(按需加载):
  • references/adapters.md
    - HTTP与WebSocket适配器选择指南
  • references/migrations.md
    - 迁移模式与故障排查
  • references/query-patterns.md
    - 查询示例与最佳实践

Templates & Scripts

模板与脚本

  • templates/schema-example.ts
    - Multi-table schema with relations
  • templates/drizzle-config.ts
    - Configuration examples
  • scripts/generate-schema.ts
    - Automated migration generation
  • scripts/run-migration.ts
    - Programmatic migration runner
  • templates/schema-example.ts
    - 带关联关系的多表模式示例
  • templates/drizzle-config.ts
    - 配置示例
  • scripts/generate-schema.ts
    - 自动化迁移生成脚本
  • scripts/run-migration.ts
    - 程序化迁移运行器

Related Skills

相关技能

  • neon-auth - Add authentication
  • neon-js - Full SDK with auth + PostgREST-style data API
  • neon-serverless - Connection setup without ORM
  • neon-toolkit - Ephemeral databases for testing
  • add-neon-docs - Add Neon best practices to your project (run after setup)

  • neon-auth - 添加认证功能
  • neon-js - 包含认证及PostgREST风格数据API的完整SDK
  • neon-serverless - 无需ORM的连接设置
  • neon-toolkit - 用于测试的临时数据库
  • add-neon-docs - 向项目中添加Neon最佳实践文档(设置完成后运行)

Workflow

工作流程

I will:
  1. Detect your project context automatically
  2. Select and load the appropriate guide
  3. Follow the guide's phases sequentially
  4. Track progress using the guide's workflow checklist
  5. Load reference files only when needed
  6. Offer to add Neon best practices to your project docs
Ready to get started? Just describe what you're building!
我会:
  1. 自动检测你的项目上下文
  2. 选择并加载合适的指南
  3. 按顺序执行指南的各个阶段
  4. 使用指南的工作流清单跟踪进度
  5. 仅在需要时加载参考文件
  6. 提供向项目文档中添加Neon最佳实践的选项
准备好开始了吗?只需描述你正在构建的项目即可!