Loading...
Loading...
This skill provides PostgreSQL-specific patterns for database design, optimization, and transaction management
npx skill4agent add ingpoc/skills postgresql-skillasync 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)
)pool = await asyncpg.create_pool(
'postgresql://user:password@localhost/db',
min_size=10,
max_size=20
)CREATE INDEX idx_user_email ON users(email);
CREATE INDEX idx_transaction_date ON transactions(created_at);