
neondb-setup
by codyde
SKILL.md
name: neondb-setup description: | Set up NeonDB PostgreSQL database with Drizzle ORM for a project. Use when the user wants to configure NeonDB or add serverless Postgres.
NeonDB Setup Skill
Provision a NeonDB serverless PostgreSQL database and configure Drizzle ORM.
Setup Steps
-
Run the get-db CLI to provision database:
npx get-db -yThis instantly creates a database and writes
DATABASE_URLto.env. The output includes the connection string and claim URL - these are automatically detected by SentryVibe. -
Install PostgreSQL and Drizzle packages:
npm install drizzle-orm pg npm install -D drizzle-kit @types/pgNote: Use standard
pgpackage - NeonDB is a PostgreSQL database. -
Create Drizzle config at
drizzle.config.ts:import { defineConfig } from 'drizzle-kit'; export default defineConfig({ dialect: 'postgresql', schema: './src/db/schema.ts', out: './drizzle', dbCredentials: { url: process.env.DATABASE_URL!, }, }); -
Create database connection at
src/db/index.ts:import { drizzle } from 'drizzle-orm/node-postgres'; import { Pool } from 'pg'; import * as schema from './schema'; const pool = new Pool({ connectionString: process.env.DATABASE_URL!, }); export const db = drizzle(pool, { schema }); -
Create example schema at
src/db/schema.ts:import { pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core'; export const users = pgTable('users', { id: serial('id').primaryKey(), name: text('name').notNull(), email: text('email').notNull().unique(), createdAt: timestamp('created_at').defaultNow().notNull(), }); -
Add database scripts to
package.json:{ "scripts": { "db:generate": "drizzle-kit generate", "db:migrate": "drizzle-kit migrate", "db:push": "drizzle-kit push", "db:studio": "drizzle-kit studio" } } -
Push schema to database:
npm run db:push
Important
- Carefully review the project and ensure that the schema.ts file created actually matches the needed schema in the project
- Database expires in 72 hours unless claimed
- Claim URL is shown in CLI output and saved to
.env- inform the user to save it - Ensure
.envis in.gitignore - Use
db:pushfor development,db:generate+db:migratefor production
Cleanup
After success, remove this skill:
rm -rf .claude/skills/neondb-setup
rmdir .claude/skills .claude 2>/dev/null
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です