Claude
Skill
postgresql
Database operations.
Download
dhaupin-vant-models_public_vant_skills_vant-skill-postgresql-e1e348e.zip · 0 KB
Install
skills CLI
npx skills add https://github.com/dhaupin/vant/tree/main/models/public/vant/skills/vant-skill-postgresql
Claude Code
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install dhaupin-vant@llmmart
Git
git clone https://github.com/dhaupin/vant.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole dhaupin/vant collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
PostgreSQL
Database operations.
When To Use
- Relational data
- Complex queries
- ACID compliance
What To Do
1. Connect
// pg
import { Pool } from 'pg'
const pool = new Pool({
connectionString: 'postgres://user:pass@localhost:5432/db'
})
const client = await pool.connect()
2. Common Queries
| Query | What |
|---|---|
| SELECT | Read data |
| INSERT | Create data |
| UPDATE | Modify data |
| DELETE | Remove data |
3. Patterns
-- Basic
SELECT * FROM users WHERE id = 1
-- Join
SELECT u.name, o.total
FROM users u
JOIN orders o ON u.id = o.user_id
-- Aggregate
SELECT COUNT(*), SUM(total) FROM orders
4. Migrations
# node-pg-migrate
npx node-pg-migrate create add_users
npx node-pg-migrate up
Output
## PostgreSQL
| Query | Rows | Time |
|-------|------|------|
| SELECT | [n] | [n]ms |
### Tables
- [list]
Role: PostgreSQL DBA Input: SQL, schema Output: Data
Relational data.
Files (vant)
-
SKILL.md 1.1 KB
--- name: postgresql description: Database operations. license: MIT metadata: author: vant version: "1.0" --- # PostgreSQL > Database operations. --- ## When To Use - Relational data - Complex queries - ACID compliance --- ## What To Do ### 1. Connect ```javascript // pg import { Pool } from 'pg' const pool = new Pool({ connectionString: 'postgres://user:pass@localhost:5432/db' }) const client = await pool.connect() ``` ### 2. Common Queries | Query | What | |-------|------| | SELECT | Read data | | INSERT | Create data | | UPDATE | Modify data | | DELETE | Remove data | ### 3. Patterns ```sql -- Basic SELECT * FROM users WHERE id = 1 -- Join SELECT u.name, o.total FROM users u JOIN orders o ON u.id = o.user_id -- Aggregate SELECT COUNT(*), SUM(total) FROM orders ``` ### 4. Migrations ```bash # node-pg-migrate npx node-pg-migrate create add_users npx node-pg-migrate up ``` --- ## Output ``` ## PostgreSQL | Query | Rows | Time | |-------|------|------| | SELECT | [n] | [n]ms | ### Tables - [list] ``` --- **Role**: PostgreSQL DBA **Input**: SQL, schema **Output**: Data > Relational data.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.