25trust / 100
Sql Explain
by Aayat AI in Developer tools
x402 APIFailing, checked 2 h ago
Explain and sanity-check a SQL query before running it: statement type, tables touched, syntax problems (quotes, parentheses, = NULL), risky patterns (UPDATE/DELETE without WHERE, DROP, NOT IN with NULLs, cartesian joins, non-sargable filters, multiple statements) and a plain-English explanation. POST {sql, dialect}.
POST https://aayatai.com/sql/explain
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 6.7%
- Response time
- 591 ms typical, 591 ms slowest 5%
- Last check
- 2 h ago: Expected HTTP 402, got 410
- Next check
- any minute now
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://aayatai.com/sql/explain" \
-H "content-type: application/json" \
-d '{"dialect":"postgres","sql":"DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Faayatai.com%2Fsql%2Fexplain
const res = await pay("https://aayatai.com/sql/explain", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"dialect":"postgres","sql":"DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"}),
});
console.log(await res.json());Example input
{
"dialect": "postgres",
"sql": "DELETE FROM users WHERE last_login < NOW() - INTERVAL '2 years'"
}Example output
{
"explanation": "Deletes every user whose last login was more than two years ago.",
"findings": [],
"statements": 1,
"tables": [
"users"
],
"type": "DELETE",
"valid": true,
"verdict": "ok"
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 2 h ago | Expected HTTP 402, got 410 | 410 | 39 ms | - |
| 6 h ago | Expected HTTP 402, got 410 | 410 | 138 ms | - |
| 11 h ago | Expected HTTP 402, got 410 | 410 | 45 ms | - |
| 15 h ago | Expected HTTP 402, got 410 | 410 | 37 ms | - |
| 19 h ago | Expected HTTP 402, got 410 | 410 | 36 ms | - |
| 23 h ago | Expected HTTP 402, got 410 | 410 | 33 ms | - |
| 27 h ago | Expected HTTP 402, got 410 | 410 | 34 ms | - |
| 31 h ago | Expected HTTP 402, got 410 | 410 | 134 ms | - |
| 35 h ago | Expected HTTP 402, got 410 | 410 | 61 ms | - |
| 40 h ago | Expected HTTP 402, got 410 | 410 | 46 ms | - |
| 43 h ago | Expected HTTP 402, got 410 | 410 | 37 ms | - |
| 2 days ago | Expected HTTP 402, got 410 | 410 | 33 ms | - |
| 2 days ago | Expected HTTP 402, got 410 | 410 | 98 ms | - |
| 2 days ago | Expected HTTP 402, got 410 | 410 | 38 ms | - |
| 2 days ago | Passed | 402 | 591 ms | $0.003 |