Classify SQL Statement
database.sql_classify_statement
Overview
You send SQL and a published dialect. Each statement is classified as READ, INSERT, UPDATE, DELETE, MERGE, DDL, TRANSACTION, SESSION, PRIVILEGE, PROCEDURAL or UNKNOWN. Parse failure is UNKNOWN, never a more permissive class. This does not run SQL. A successful call costs 2 execution credits.
Agents need an offline SQL effect class that cannot execute the statement.
Reliability
SQL_CLASSIFY_LIMIT_EXCEEDED — trigger: more than 2 MiB or 1000 statements; retryable: no; next: split the batch.
Context footprint
SQL text is classified only. A successful call costs 2 execution credits.
When to use it
When the caller already holds SQL and needs a conservative effect class.
When the SQL must be executed or explained against a live database.
Powered by JSqlParser 5.3. Parse failure yields UNKNOWN, never a more permissive class.
Scope
Non-goals
- Does not execute SQL
- Does not prove row-level effects
- Does not interpret stored-procedure bodies
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| sql | string | Yes | SQL text, 1 through 2097153 characters; runtime accepts at most 2097152. |
| dialect | string | No | Published dialect; omit it for ANSI. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| statements | array | Yes | Ordered closed classification rows, 0 through 1000, each with index, classification, optional objectName and dialect. |
| statementCount | integer | Yes | How many top-level statements were classified. |
| dialect | string | Yes | Dialect that was applied. |
| diagnostics | array | Yes | Parse-uncertainty diagnostics, empty when every statement classified from an AST. |
| engine | string | Yes | Pinned JSqlParser Maven coordinate. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"database.sql_classify_statement","input":{"sql":"SELECT id FROM users"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("database.sql_classify_statement", {"sql":"SELECT id FROM users"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| SQL_CLASSIFY_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not execute SQL
- Does not prove row-level effects
- Does not interpret stored-procedure bodies
- Query planning
- Authorization
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "database.sql_classify_statement",
"input": {
"sql": "SELECT id FROM users"
}
}Examples
A SELECT is classified as READ
{
"sql": "SELECT id FROM users"
}{
"statements": [
{
"index": 0,
"classification": "READ",
"dialect": "ANSI"
}
],
"statementCount": 1,
"dialect": "ANSI",
"diagnostics": [],
"engine": "com.github.jsqlparser:jsqlparser"
}A DROP TABLE is classified as DDL
{
"sql": "DROP TABLE users"
}{
"statements": [
{
"index": 0,
"classification": "DDL",
"objectName": "users",
"dialect": "ANSI"
}
],
"statementCount": 1,
"dialect": "ANSI",
"diagnostics": [],
"engine": "com.github.jsqlparser:jsqlparser"
}Recommended use cases
- Gate a migration by statement class
- Separate reads from DDL before a review
Avoid for
- Query planning
- Authorization
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.