Generate comprehensive network traffic covering all PostgreSQL operations for testing protocol implementations and benchmarking. Includes build, run, and cleanup commands.
Generate comprehensive network traffic covering all PostgreSQL operations for testing protocol implementations and benchmarking.
This skill helps you work with a PostgreSQL operations generator that creates network traffic for all PostgreSQL operations. It's designed for testing PostgreSQL protocol implementations and benchmarking database performance.
The tool organizes code into:
PostgreSQL operations are organized into categories: basic, schema, data, transaction, advanced, catalog, admin, types, copy, prepared, listen-notify, roles.
When working with this PostgreSQL traffic generator:
1. **Database Configuration**
- Configuration loads from `src/.env` (not repository root)
- Uses pg library with connection pooling
- Verify all required env vars are set: PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD
2. **Building and Running**
- Build the project: `npm run build`
- Run all operations: `npm run run-all`
- Run specific category: `npm run <category>` (e.g., `npm run basic`, `npm run schema`, `npm run data`)
- Clean up created database objects: `npm run cleanup`
3. **Development**
- Run TypeScript directly: `ts-node src/index.ts <command>`
- All CLI commands defined in src/index.ts using Commander.js
- Each operation category has its own method in the `pgOps` object and corresponding npm script
4. **Adding New Operations**
- Add new operation methods to the `pgOps` object in src/operations.ts
- Register new commands in src/index.ts CLI definition
- Create corresponding npm script in package.json if needed
- Follow existing category patterns (basic, schema, data, etc.)
5. **Testing Protocol Implementations**
- Use specific category runners to test individual PostgreSQL feature sets
- Run cleanup between test runs to ensure clean state
- Monitor network traffic during operations for protocol analysis
6. **Troubleshooting**
- Check src/.env configuration if connection fails
- Verify PostgreSQL server is running and accessible
- Use `npm run cleanup` to remove leftover test objects
- Review src/db.ts for connection pool settings
```bash
npm run build
npm run run-all
npm run basic
npm run schema
npm run data
npm run cleanup
ts-node src/index.ts basic
ts-node src/index.ts cleanup
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/postgresql-traffic-generator/raw