# db_query (https://lazyfrog.dev/docs/tools/db_query)

{/* Generated by scripts/generate-docs.ts from the gateway's registered tools. Do not edit. */}

**{"Query the database"}** · Can change or delete

<p>{"Run SQL on the project's PostgreSQL 19 (env preview by default, or production: the live site's real data). Reads run directly, on production in a read-only transaction with a 5-second limit, and the result says it is live data. A statement that writes runs on preview after an automatic snapshot; on production it needs the db:production permission and confirm: true, and one that drops, truncates or alters, or updates or deletes without a WHERE clause (or about a thousand rows or more), waits for the owner's approval in the portal first. Prefer migration files (db migrate) for schema changes. Results are capped (max_rows, default 100); values come back as text. For a SELECT use db_read."}</p>
