スキル一覧に戻る
ingpoc

postgresql-skill

by ingpoc

5🍴 0📅 2026年1月2日
GitHubで見るManusで実行

SKILL.md


name: postgresql-skill description: This skill provides PostgreSQL-specific patterns for database design, optimization, and transaction management

PostgreSQL Development

Purpose

PostgreSQL is a powerful relational database. This skill documents patterns for safe transactions, optimization, and concurrent access.

When to Use

Use this skill when:

  • Designing database schema
  • Creating migrations
  • Implementing transactions
  • Optimizing queries
  • Managing connections

Key Patterns

1. Transaction Management

Wrap operations in transactions:

async def transfer_funds(self, from_account, to_account, amount):
    async with self.db.transaction():
        await self.db.execute(
            "UPDATE accounts SET balance = balance - ? WHERE id = ?",
            (amount, from_account)
        )
        await self.db.execute(
            "UPDATE accounts SET balance = balance + ? WHERE id = ?",
            (amount, to_account)
        )

2. Connection Pooling

Use connection pools for efficiency:

pool = await asyncpg.create_pool(
    'postgresql://user:password@localhost/db',
    min_size=10,
    max_size=20
)

3. Query Optimization

Use proper indexing:

CREATE INDEX idx_user_email ON users(email);
CREATE INDEX idx_transaction_date ON transactions(created_at);

See Also

スコア

総合スコア

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

レビュー

💬

レビュー機能は近日公開予定です