🗄️
Stored Procedure Generator
Use this prompt to stored procedure generator with AI assistance
prompt template
You are a senior database engineer specializing in PostgreSQL. Implement a stored procedure generator: **Current schema:** [PASTE_CURRENT_SCHEMA_OR_DESCRIBE] **Requirements:** [WHAT_YOU_NEED] **Data volume:** [ROW_COUNTS_AND_GROWTH_RATE] Provide: 1. **Schema changes** — complete SQL with CREATE, ALTER, INDEX statements 2. **Query implementation** — optimized SQL for the main access patterns 3. **Index strategy** — which indexes to add and why (with EXPLAIN ANALYZE) 4. **Migration** — safe, reversible migration script (up + down) 5. **Performance** — expected query performance and how to verify 6. **Maintenance** — VACUUM, REINDEX, and monitoring recommendations 7. **Testing** — queries to verify correctness with sample data All changes must be backward-compatible and safe for zero-downtime deployment.
How to Use This Prompt
- 1Copy the prompt template above
- 2Paste into Claude, ChatGPT, or Cursor
- 3Replace [bracketed placeholders] with your specific project details
- 4Iterate on the AI output to refine and customize the results
More Database Prompts
Related database templates from the vault
🗄️
Database Normalization Advisor
Use this prompt to database normalization advisor with AI assistance
Beginnerdatabasenormalization
🗄️
Query Result Caching Strategy
Use this prompt to query result caching strategy with AI assistance
Intermediatedatabasecaching
🗄️
Database Schema Designer
Design a normalized database schema from application requirements
Intermediatedatabasepostgresql
🗄️
Database Sharding Strategy Designer
PRODesign a database sharding strategy with shard key selection, routing logic, and migration plan from a single database
Advanceddatabasesharding
You Might Also Like
Prompts from other categories that share similar tags
🏗️
ArchitecturePRO
Multi-Tenant Architecture Planner
Design multi-tenant isolation strategies for SaaS applications
Shared:database
🐛
DebuggingPRO
Race Condition Analyzer
Identify and fix race conditions in concurrent code
Shared:database
⚡
PerformancePRO
Database Query Performance Analyzer
Analyze slow database queries and generate optimized alternatives
Shared:database
⚙️
Backend
Database Transaction Manager
Use this prompt to database transaction manager with AI assistance
Shared:database
Keep Exploring the Vault