Group
  • Data Layer Defense Pack

    Injection-proof queries, safe secrets handling, and schema guardrails for your database.

    42 prompts

Prompts In This Pack

  • Database

    Add a periodic data integrity audit

    Runs scheduled consistency checks (orphans, bad states, drift) so data problems surface before users find them.

    • Automate workflows
    • Improve quality
    • Advanced
    • General
  • Database

    Add database-level validation and constraints

    Adds NOT NULL, CHECK constraints, and correct column types so bad data can't be written no matter what the app does.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Database

    Add foreign keys and decide delete behavior

    Enforces relationships at the database level and makes deletes cascade, restrict, or null out deliberately.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Database

    Add the indexes my queries actually need

    Reads your real queries, finds the lookups doing full collection scans, and adds the right indexes.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General
  • Database

    Add pagination to every list endpoint

    Replaces unbounded fetch-everything queries with cursor or offset pagination before tables get big.

    • Improve quality
    • Plan & validate
    • Beginner
    • General
  • Database

    Guard seed and fixture data out of production

    Adds environment guards so test users, demo records, and seed scripts can never run or leak into production.

    • Improve quality
    • Plan & validate
    • Beginner
    • General
  • Database

    Add unique constraints where duplicates are bugs

    Enforces uniqueness at the database level for emails, slugs, and one-per-user records so races can't create duplicates.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Security

    Audit my auth flow for common vulnerabilities

    Reviews your login, signup, and session handling for issues like missing rate limiting, weak token storage, and unprotected routes.

    • Improve quality
    • Intermediate
    • Cursor
    • General
  • Database

    Audit cascade deletes for accidental data loss

    Traces every delete path to find cascades that could wipe out more data than intended.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Security

    Audit my database's public access rules

    Checks Supabase row-level security, Firebase rules, and client-exposed databases for tables anyone can read or write.

    • Improve quality
    • Debug & fix
    • Intermediate
    • Lovable
    • Bolt
    • Replit
    • General
  • Database

    Audit my schema for design mistakes that don't scale

    Reviews your full data model for the structural choices that cause pain later: god tables, missing relationships, and fields doing two jobs.

    • Plan & validate
    • Improve quality
    • Advanced
    • General
  • Database

    Find and fix slow queries with the slow query log

    Enables slow query logging, ranks the worst offenders, and fixes them with indexes or rewrites.

    • Debug & fix
    • Improve quality
    • Intermediate
    • General
  • Database

    Find and drop indexes my app never uses

    Uses database statistics to find indexes with zero or near-zero reads and removes them to speed up writes.

    • Debug & fix
    • Improve quality
    • Intermediate
    • General
  • Database

    Cap unbounded text fields

    Adds length limits to user text fields and columns so no single record can bloat rows, pages, or payloads.

    • Improve quality
    • Plan & validate
    • Beginner
    • General
  • Database

    Choose a safe ID strategy for records

    Moves public-facing identifiers to unguessable IDs while keeping efficient internal keys, ending enumerable resource URLs.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Database

    Design a schema for user-generated content

    Plans tables, indexes, and relationships for posts, comments, and likes with sane defaults and soft-delete support.

    • Plan & validate
    • Intermediate
    • General
  • Database

    Enforce discipline on JSON fields

    Audits schemaless JSON columns for structure drift and locks down validation, indexing, and size limits.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Database

    Make sure tenants can't see each other's data

    Audits every query in a multi-tenant app to confirm it is scoped by tenant or organization ID, and adds the missing filters.

    • Improve quality
    • Plan & validate
    • Advanced
    • General
  • Database

    Handle concurrent writes without lost updates

    Fixes read-modify-write races (counters, balances, inventory) with atomic operations or optimistic locking.

    • Debug & fix
    • Improve quality
    • Advanced
    • General
  • Security

    Find and fix exposed environment variables

    Scans your client-side code for API keys and secrets that should live on the server, then moves them behind a safe API layer.

    • Improve quality
    • Debug & fix
    • Beginner
    • Replit
    • Cursor
    • Bolt
    • Lovable
    • General
  • Database

    Fix my N+1 query problems

    Finds loops that query per item and rewrites them as joins, eager loads, or batched lookups.

    • Debug & fix
    • Improve quality
    • Intermediate
    • Cursor
    • General
  • Database

    Fix null vs. empty value handling

    Standardizes when fields are null, empty string, or absent so reads stop breaking on inconsistent emptiness.

    • Improve quality
    • Debug & fix
    • Beginner
    • General
  • Database

    Diagnose and fix database lock contention

    Finds long-running transactions and lock-heavy code paths, then shortens transactions and adds deadlock retry handling.

    • Debug & fix
    • Improve quality
    • Advanced
    • General
  • Database

    Make large data exports not kill the server

    Moves CSV/JSON exports out of request handlers into streamed, background-generated downloads.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General
  • Database

    Harden my database queries against injection

    Refactors string-interpolated queries into parameterized statements and adds input validation at the boundary.

    • Improve quality
    • Debug & fix
    • Advanced
    • Cursor
    • General
  • Database

    Implement soft deletes without breaking queries

    Adds deleted_at handling with every query updated to respect it, plus a purge path for real deletion.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Database

    Audit my database network exposure and TLS

    Confirms the database isn't reachable from the public internet and that connections use TLS with verified certificates.

    • Plan & validate
    • Improve quality
    • Intermediate
    • General
  • Database

    Find and fix database storage bloat

    Identifies the tables eating disk (logs, dead rows, oversized payloads) and reclaims space with cleanup and maintenance.

    • Debug & fix
    • Automate workflows
    • Intermediate
    • General
  • Database

    Write a database disaster recovery plan

    Documents exactly what to do when the database is lost or corrupted, with timed restore drills and clear recovery targets.

    • Plan & validate
    • Intermediate
    • General
  • Database

    Backfill a big table without taking my app down

    Plans and writes a batched, resumable backfill for populating a new column on a large production table.

    • Plan & validate
    • Ship faster
    • Advanced
    • General
  • Security

    Prevent NoSQL injection in my queries

    Stops query operator injection by validating input types and stripping $-prefixed keys before they reach the database.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General
  • Security

    Restrict my app's database user permissions

    Splits the app's database credentials away from superuser access and scopes them to what the app actually needs.

    • Improve quality
    • Plan & validate
    • Intermediate
    • General
  • Deployment

    Deploy database migrations without breaking production

    Run schema changes safely against a live database with zero-downtime patterns and a plan for the bad case.

    • Plan & validate
    • Improve quality
    • Advanced
    • General
  • Database

    Add query timeouts to database calls

    Sets statement and request timeouts so slow or stuck queries fail fast instead of piling up behind a struggling database.

    • Debug & fix
    • Improve quality
    • Beginner
    • General
  • Database

    Set up database connection pooling and timeouts

    Configures a sane connection pool and query timeouts so traffic spikes can't exhaust your database connections.

    • Debug & fix
    • Plan & validate
    • Intermediate
    • General
  • Database

    Set up data retention and cleanup jobs

    Adds scheduled cleanup for expired sessions, stale tokens, old logs, and abandoned records so tables don't grow forever.

    • Automate workflows
    • Plan & validate
    • Intermediate
    • General
  • Database

    Set up database backups and test a restore

    Configures automated backups with retention, then actually restores one to prove it works.

    • Plan & validate
    • Automate workflows
    • Beginner
    • General
  • Database

    Set up real database migrations

    Replaces manual schema edits and auto-sync with versioned, runnable migrations that work the same everywhere.

    • Plan & validate
    • Ship faster
    • Intermediate
    • Cursor
    • General
  • Database

    Set up basic database monitoring

    Adds visibility into connections, slow queries, disk growth, and locks with alerts before they become outages.

    • Automate workflows
    • Plan & validate
    • Intermediate
    • General
  • Database

    Standardize date, time, and timezone handling

    Audits how the app stores and displays dates so users in different timezones stop seeing wrong times and off-by-one dates.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General
  • Database

    Stop storing money as floats

    Finds every money value stored or calculated as a floating point number and converts it to integer cents or a decimal type.

    • Improve quality
    • Debug & fix
    • Intermediate
    • General
  • Database

    Wrap multi-step writes in transactions

    Finds write flows that touch multiple records and makes them atomic so partial failures can't corrupt state.

    • Improve quality
    • Debug & fix
    • Advanced
    • General

Want to skip doing this by hand?

Fortivibe audits your app for all of the areas these prompts cover (and more).

See What We Check

More Prompt Packs