✨ AI SQL Generation
Writing SQL for every test case slows you down — especially when you're covering large schemas, repetitive patterns, or fast-moving requirements. X-AutoMate's AI SQL Generation lets you describe what you want, and the assistant writes the query for you.
🎯 Stop typing the same
SELECT COUNT(*)ten times a day. Let the AI handle the boilerplate.
🧠 What You Can Generate
X-AutoMate's AI can generate queries for:
- 🏗️ ETL test cases — based on your selected Test Approach + metadata
- 🧼 Custom DQ checks — generate
count,bad_count, andverifyqueries
In both cases, you can:
- ✏️ Provide plain-language instructions to steer the generation
- 🔁 Regenerate the query with updated instructions if the first try misses the mark
🏗️ Generate ETL Queries
When creating an ETL test case, once you've picked a Test Approach and provided the relevant metadata, you can ask the AI to generate the SQL query that fits that approach.

✏️ Steering the Generation with Instructions
If you need a specific behavior — extra filters, special handling, a particular join — just add instructions in plain language and the AI will adjust accordingly.

🔁 Regenerating with Updated Instructions
If the result isn't quite what you wanted, update the instruction and regenerate. The AI will produce a fresh query that respects your changes.

Think of the instruction field like a chat prompt. Be specific: "exclude inactive rows", "only check the last 30 days", "group by region" — the more direction you give, the better the query.
🎨 Custom Query Mode
There's a special mode tied to the custom_query approach. Here you don't need to pick metadata at all — just describe what you want the assistant to generate, and it will produce the SQL based on your description.
💡 Perfect for when you have a one-off check that doesn't fit a standard approach.
🧼 Generate Custom DQ Queries
Custom DQ checks need three queries: a total count, a bad count, and a verification. The AI can generate all three for you.
The flow mirrors the ETL one:
- Select your approach and metadata
- Hit Generate — the AI produces the queries
- Refine with instructions and regenerate as needed
If you choose the custom_query approach for the DQ check, you get the same plain-language behavior as in ETL — describe the rule, get the SQL.
After you've written the bad-count query yourself, you can ask the AI to generate the matching total-count and verification queries based on it. Saves you the boring two-thirds of the work.
📌 Summary
| Mode | What you give | What the AI produces |
|---|---|---|
| ETL / Approach-based | Test approach + metadata (+ optional instructions) | SQL query tailored to the approach |
| Custom Query (ETL) | Plain-language description | SQL query from the description |
| Custom DQ Check | Approach + metadata (+ optional instructions) | count, bad_count, verify queries |
Custom DQ from bad_count | A bad_count query you wrote | Matching total_count and verify queries |
🚀 Migrating from another DB technology? Check out the AI Query Translator to port queries between dialects.