Claude Integration
Using Claude with DBTrail
Query your MySQL change history using natural language
After Claude Setup, ask in plain words.
Questions about your data
Connected to the web interface, Claude answers with SQL on the copy of your tables, without touching your MySQL:
You: Which 5 customers spent the most last month?
Claude: I ran this on the copy (updated 2 minutes ago):
SELECT customer, sum(amount) AS spent FROM production.orders WHERE created_at >= date_trunc('month', current_date) - INTERVAL 1 MONTH AND created_at < date_trunc('month', current_date) GROUP BY customer ORDER BY spent DESC LIMIT 5
Claude shows the query it ran and how current the copy is, so you can check
both. See sql for the limits.
Questions about changes

You: Generate SQL to recover the deleted order 1042.
Claude: Here's the recovery SQL (dry-run). Review before executing:
BEGIN; INSERT INTO `production`.`orders` (`order_id`, `customer`, `amount`, `status`) VALUES (1042, 'acme-corp', 299.00, 'active'); COMMIT;
Always review recovery SQL
Claude generates the SQL and never executes it. A person reviews and runs it.
Better questions
- Name the server when you have several.
- Give a time range: "since the deploy at 2pm yesterday".
- Name the event type and table: "only DELETEs in mydb.orders".
- Ask for first or last: "the first DELETE after 14:00" returns oldest first without scanning everything.
Limits
- Reads only: SQL on the copy is read-only (web interface only), and there are no data changes, no starting or stopping streams.
- No rate limits of its own.
- Who made a change (MySQL user, host, program) is not answered; the
index keeps each change's raw
connection_id.