SQL Syntax Checker
database.sql_validate_syntax
Overview
You pass SQL and a dialect; we check whether it parses at PARSE_ONLY level. We do not resolve table schemas, validate types, or run the statement. validationLevel in the response is always PARSE_ONLY. Do not use this when you need semantic, schema-aware, or runtime validation.
It's easy to say "SQL is validated" when you only mean "it parsed once." We label the level honestly so you know what you're getting.
Reliability
STRICT within the pinned JSqlParser profile. validationLevel is always PARSE_ONLY — syntax only, no schema or runtime checks. Domain errors (not retryable — fix input): SQL_DIALECT_UNSUPPORTED (dialect not in the supported list); SQL_PARSE_LIMIT_EXCEEDED (statement exceeds 200,000 characters or nesting depth 32); SQL_STATEMENT_LIMIT_EXCEEDED (more than 50 statements when allowMultipleStatements is true). Parse failures appear in findings[] with code SQL_SYNTAX_ERROR and do not raise a domain error — inspect findings and correct the SQL.
Context footprint
One call — pass SQL and dialect, get valid/invalid plus per-statement detail. A successful call costs 1 execution credit.
When to use it
When you need a fast syntax gate before deeper checks or execution.
When you need schema resolution, type checking, or a live dry-run.
Powered by JSqlParser, an open-source SQL parser used for dialect-aware tokenization at PARSE_ONLY level — no schema resolution or execution.
Scope
Non-goals
- Does not resolve schemas or table names
- Does not execute SQL
- Does not validate column types or constraints
- Does not prove the statement will succeed at runtime
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 | Bounded SQL source parsed without execution. |
| dialect | string | No | SQL dialect; omit it for generic. |
| allowMultipleStatements | boolean | No | Whether more than one statement is accepted; omit it for false. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | Whether parsing found no syntax error. |
| dialect | string | Yes | Applied SQL dialect. |
| statementCount | integer | Yes | Parsed statement count. |
| statements | array | Yes | Bounded array of parsed statement receipts in source order. The item shape is defined by the nested schema and the array contains from 0 through 10000 items. |
| findings | array | Yes | Bounded array of safe structured database findings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items. |
| validationLevel | string | Yes | Applied validation level. |
| _meta | object | Yes | Closed SQL parser metadata receipt. Its documented receipt properties are bounded to 128 entries — unconstrained RFC 8259 JSON items. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"database.sql_validate_syntax","input":{"sql":"SELECT 1","dialect":"postgresql"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("database.sql_validate_syntax", {"sql":"SELECT id FROM users WHERE active = true","dialect":"postgresql"});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_DIALECT_UNSUPPORTED | 400 | No | The skill does not support the requested variant. |
| SQL_PARSE_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| SQL_STATEMENT_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 resolve schemas or table names
- Does not execute SQL
- Does not validate column types or constraints
- Does not prove the statement will succeed at runtime
- Schema-aware or semantic validation
- Proving a query is safe to run in production
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "database.sql_validate_syntax",
"input": {
"sql": "SELECT id FROM users WHERE active = true",
"dialect": "postgresql"
}
}Examples
Valid PostgreSQL select
{
"sql": "SELECT id FROM users WHERE active = true",
"dialect": "postgresql"
}{
"dialect": "postgresql",
"statements": [
{
"type": "PLAINSELECT",
"valid": true,
"index": 0
}
],
"statementCount": 1,
"findings": [],
"valid": true,
"_meta": {
"parserProfile": "jsqlparser-5.3"
},
"validationLevel": "PARSE_ONLY"
}Malformed SQL returns parse findings
{
"sql": "SELECT FROM broken",
"dialect": "postgresql"
}{
"dialect": "postgresql",
"statements": [],
"statementCount": 0,
"findings": [
{
"details": {},
"path": "/sql",
"code": "SQL_SYNTAX_ERROR",
"message": "SQL could not be parsed: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: \"SELECT\" <K_SELECT> at line 1, column 1. Was expecting one of: \"WITH\" <ST_SEMICOLON>",
"severity": "error"
}
],
"valid": false,
"_meta": {
"parserProfile": "jsqlparser-5.3"
},
"validationLevel": "PARSE_ONLY"
}Recommended use cases
- Reject obviously malformed SQL before submission
- Gate agent-generated queries in a CI step
- Confirm dialect tokenization before parameterization
Avoid for
- Schema-aware or semantic validation
- Proving a query is safe to run in production
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.