← スキル一覧に戻る

postgresql
by nimranaz148
⭐ 0🍴 0📅 2026年1月11日
SKILL.md
name: postgresql description: PostgreSQL database patterns for Neon serverless database. Use when configuring database connections, writing queries, or optimizing PostgreSQL for the Todo backend. allowed-tools: Read, Edit, Write, Glob, Grep, Bash
PostgreSQL Skill
Quick Reference
PostgreSQL is the database used with Neon Serverless for the Todo app.
Neon Connection
DATABASE_URL = os.getenv(
"DATABASE_URL",
"postgresql://user:pass@ep-xxx.us-east-1.aws.neon.tech/neon?sslmode=require"
)
# SSL is required for Neon
engine = create_engine(
DATABASE_URL,
pool_pre_ping=True, # Verify connection before use
)
Common Queries
-- List tasks for user
SELECT * FROM tasks WHERE user_id = 'user_123' ORDER BY created_at DESC;
-- Count tasks by status
SELECT completed, COUNT(*) FROM tasks WHERE user_id = 'user_123' GROUP BY completed;
-- Search tasks
SELECT * FROM tasks WHERE title ILIKE '%groceries%';
-- Update task
UPDATE tasks SET completed = true, updated_at = NOW() WHERE id = 1 AND user_id = 'user_123';
-- Delete task
DELETE FROM tasks WHERE id = 1 AND user_id = 'user_123';
Indexes for Performance
-- User task lookup
CREATE INDEX IF NOT EXISTS idx_tasks_user_id ON tasks(user_id);
-- Status filtering
CREATE INDEX IF NOT EXISTS idx_tasks_user_completed ON tasks(user_id, completed);
-- Date sorting
CREATE INDEX IF NOT EXISTS idx_tasks_user_created ON tasks(user_id, created_at DESC);
For Detailed Reference
See REFERENCE.md for:
- Advanced queries
- Performance tuning
- Neon-specific considerations
- Backup and recovery
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です