Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Classify SQL Statement

database.sql_classify_statement

ProductionEngine wrapper (Class A)Deterministicstrictmoderatev1.0.0
No network

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

Note
Classifies each top-level SQL statement by effect without executing it.

Non-goals

  • Does not execute SQL
  • Does not prove row-level effects
  • Does not interpret stored-procedure bodies

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisparsing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call2 credits

File handling

Accepts file_refProduces file_refMax input2 MB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
sqlstringYesSQL text, 1 through 2097153 characters; runtime accepts at most 2097152.
dialectstringNoPublished dialect; omit it for ANSI.

Output schema

FieldTypeRequiredDescription
statementsarrayYesOrdered closed classification rows, 0 through 1000, each with index, classification, optional objectName and dialect.
statementCountintegerYesHow many top-level statements were classified.
dialectstringYesDialect that was applied.
diagnosticsarrayYesParse-uncertainty diagnostics, empty when every statement classified from an AST.
enginestringYesPinned JSqlParser Maven coordinate.

API contract

POST /v1/execute
curl
curl -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"}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
SQL_CLASSIFY_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "skillKey": "database.sql_classify_statement",
  "input": {
    "sql": "SELECT id FROM users"
  }
}

Examples

A SELECT is classified as READ

Inputjson
{
  "sql": "SELECT id FROM users"
}
Expected outputjson
{
  "statements": [
    {
      "index": 0,
      "classification": "READ",
      "dialect": "ANSI"
    }
  ],
  "statementCount": 1,
  "dialect": "ANSI",
  "diagnostics": [],
  "engine": "com.github.jsqlparser:jsqlparser"
}
Tip
SELECT becomes READ with objectName users.

A DROP TABLE is classified as DDL

Inputjson
{
  "sql": "DROP TABLE users"
}
Expected outputjson
{
  "statements": [
    {
      "index": 0,
      "classification": "DDL",
      "objectName": "users",
      "dialect": "ANSI"
    }
  ],
  "statementCount": 1,
  "dialect": "ANSI",
  "diagnostics": [],
  "engine": "com.github.jsqlparser:jsqlparser"
}
Tip
DROP is DDL, never a read.
  • Gate a migration by statement class
  • Separate reads from DDL before a review

Avoid for

  • Query planning
  • Authorization

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.

Tags

validationsqldatabase