neon-drizzle

作者: neondatabase

创建一个功能完整的 Drizzle ORM 环境,并配备已配置的 Neon 数据库。安装依赖项、配置数据库凭据、设置连接…

npx skills add https://github.com/neondatabase/ai-rules --skill neon-drizzle

Neon Drizzle Integration

Comprehensive Drizzle ORM setup for Neon databases with guided workflows.

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

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

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.

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

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

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

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)

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!

来自 neondatabase 的更多技能

claimable-postgres
neondatabase
为本地开发、演示、原型设计和测试环境提供即时Postgres数据库。无需账户。除非认领到Neon账户,否则数据库将在72小时后过期。
neon
neondatabase
Neon平台概述,涵盖Postgres、Auth、Data API以及新服务:对象存储、计算函数和AI网关。当提到“Neon”时,用于概述如何与Neon协作及如何入门。否则,各项独立功能为触发点:“对象存储”或“S3兼容存储”、“无服务器函数”、“后台任务”或“在数据库附近运行代码”、“AI网关”、“LLM代理”、“模型路由”或“调用LLM”→...
apidatabasedevelopment
plugin-manager
neondatabase
管理此仓库在Cursor和Claude Code中的插件结构与配置。在创建、更新或审查插件文件夹时使用…
skill-creator
neondatabase
创建有效技能的指南。当用户想要创建新技能(或更新现有技能)以扩展Claude的功能时,应使用此技能。
using-neon
neondatabase
使用Neon Serverless Postgres的指南和最佳实践。涵盖入门、使用Neon进行本地开发、选择连接方法、Neon…
neon-js-react
neondatabase
在 React 应用(Vite、CRA)中设置完整的 Neon SDK,包含身份验证和数据库查询。创建类型化客户端、生成数据库类型并配置…
postgres-best-practices
neondatabase
使用Postgres的最佳实践和指南。涵盖模式设计、索引策略、查询优化、迁移以及常见陷阱。使用…
neon-postgres-egress-optimizer
neondatabase
指导用户诊断并修复导致其Postgres数据库产生过多数据传输(出站流量)的应用端查询模式。大多数高额出站流量账单源于应用程序获取的数据量超出实际使用量。