Prompt·Writes and ingestion·PG05
Map every place that writes to the database
Several jobs, functions, APIs or agents change the same data, or nobody is sure who owns it.
Prompt
Map the actual write paths for the important tables in this application. Identify every script, job, API, function, trigger and agent that can create, update or delete their records. Show who owns each field, which paths overlap, and where two writers can disagree or overwrite each other. Recommend the simplest ownership model supported by the existing system.
- What it returns
- A map from each writer to its tables and columns, then to triggers, side effects and consumers, with the cases where writers overlap or conflict.
- Skip it when
- One code path writes each table.
- Avoid
- Treating every extra writer as wrong. Find the paths that actually conflict.
- Changes
- Changes nothing
- Sessions
- Look first, then fix in a new session
- Tools
- Repository and read-only database access.
- Works on
- Any PostgreSQL host: Supabase, Neon, RDS, Cloud SQL or self-hosted.
Related prompts
- Two systems that disagreePromptFinds data kept in two places (a saved copy and a table, the browser and the server) that can quietly disagree.
- Updates that overwrite each otherPromptFinds updates that overwrite newer data because two things wrote at once.
- Stop rewriting data that hasn't changedPromptUpserts and updates run at high volume, imports are costly, or vacuum and write-ahead log churn look high.
- Find where write logic should livePromptBusiness rules are split across SQL, triggers, edge functions, server routes and workers.
More in Writes and ingestion.