Skip to main content

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

MicroSkills Reference

Format SQL

code.format_sql

ProductionBounded custom (Class B)Deterministicverifiablefastv1.0.0
No network

Overview

When you send SQL text, we reflow it deterministically using lexical tokenization: keyword case, clause line breaks, and optional minification. We recognize one shared keyword set rather than a vendor grammar, so we never build a parse tree or validate syntax. We never connect to a database or execute SQL — do not use this for semantic validation or dialect-perfect pretty-printing.

You should be able to clean SQL for humans to read without any execution risk. We reflow whitespace and keywords the same way every time.

Reliability

Deterministic lexical formatting; identical input yields identical output. Invalid SQL is not rejected — only whitespace and keyword case change. Oversized input throws SIZE_LIMIT_EXCEEDED — shorten the SQL before retrying.

Context footprint

Returns formatted SQL, a changed flag, statement count, and warnings. A successful call costs 1 execution credit.

When to use it

When you have SQL text and need readable or minified formatting offline.

When you need semantic validation, execution, or dialect-accurate layout.

Scope

Note
Reformats SQL text lexically; never executes or connects to a database.

Non-goals

  • Does not run SQL
  • Does not connect to databases
  • Does not validate against a schema
  • Does not build a parse tree or prove syntax validity
  • Not a dialect-aware formatter — vendor grammar is not fully modeled

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

formatting

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input976.6 KB

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

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 may contain submitted or transformed 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
sqlstringYesExact SQL text to reflow.
dialectstringNoValidated inert dialect label; omit it for generic.
keywordCasestringNoRecognized-keyword case policy; omit it for upper.
indentintegerNoContinuation-clause indentation; omit it for 2.
lineWidthintegerNoValidated inert line-width value; omit it for 120.
formatModestringNoPretty or minified layout; omit it for pretty.

Output schema

FieldTypeRequiredDescription
formattedstringYesReflowed SQL text after lexical pretty-print or minify.
changedbooleanYesWhether the formatted text differs from the input.
statementsintegerYesNumber of non-empty lexical SQL statements.
warningsarrayYesFrom 0 through 10 safe advisory strings; currently always empty because the formatter has no warnings.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"code.format_sql","input":{"sql":"select 1"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("code.format_sql", {"sql":"select * from users where id=1"});

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.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not run SQL
  • Does not connect to databases
  • Does not validate against a schema
  • Does not build a parse tree or prove syntax validity
  • Not a dialect-aware formatter — vendor grammar is not fully modeled
  • Validating SQL against a live database
  • Dialect-perfect pretty-printing

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "code.format_sql",
  "input": {
    "sql": "select * from users where id=1"
  }
}

Examples

Pretty-print a simple SELECT

Inputjson
{
  "sql": "select * from users where id=1"
}
Expected outputjson
{
  "changed": true,
  "statements": 1,
  "formatted": "SELECT *\nFROM users\nWHERE id = 1\n",
  "warnings": []
}

Minify removes extra line breaks

Inputjson
{
  "sql": "select\n  id\nfrom users",
  "formatMode": "minify"
}
Expected outputjson
{
  "changed": true,
  "statements": 1,
  "formatted": "SELECT id FROM users;",
  "warnings": []
}
  • Clean SQL for review or documentation
  • Normalize keyword case before sharing
  • Minify SQL for compact transport

Avoid for

  • Validating SQL against a live database
  • Dialect-perfect pretty-printing

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

codeformattingsql