Skip to main content

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

MicroSkills Reference

SQL Table Reference Extractor

database.sql_extract_tables

ProductionEngine wrapper (Class A)Deterministicstrictfastv1.0.0
No network

Overview

You pass a SQL statement and we report tables, common table expressions, column references (when requested), and write targets with role and access mode. We do not resolve schemas or expand SELECT *. Do not use this when you need column lineage or schema-qualified expansion.

Regex table lists miss writes and CTEs. We walk the parse tree so you see what the statement actually references.

Reliability

STRICT within the pinned parser (max 2,000 table references). Domain errors (not retryable — fix input): SQL_PARSE_FAILED (SQL does not parse for the dialect — correct the statement; retrying unchanged input will not succeed); SQL_DIALECT_UNSUPPORTED (dialect not in the supported list — choose a supported dialect); SQL_REFERENCE_LIMIT_EXCEEDED (more than 2,000 references — shorten or split the statement); SQL_PARSE_LIMIT_EXCEEDED (statement exceeds 200,000 characters or nesting depth 32 — reduce size or complexity).

Context footprint

One call returns tables, writes, CTEs, and wildcard flags for your gate logic. A successful call costs 1 execution credit.

When to use it

When you need referenced tables, CTEs, or write targets before allowing execution.

When you need schema-aware column expansion or cross-query lineage.

Powered by JSqlParser, an open-source SQL parser used to walk the statement AST and collect table references.

Scope

Note
Extracts table, CTE, and write-target references from SQL you provide.

Non-goals

  • Does not resolve schemas or expand wildcards
  • Does not prove read-only intent at runtime
  • Does not build full column lineage graphs

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisparsing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input256 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.
  • Output may reveal sensitive derived information
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
sqlstringYesBounded SQL source parsed without execution.
dialectstringNoSQL dialect; omit it for generic.
optionsobjectNoPurpose-bound bounded extraction option object; omit it for safe defaults. It contains from 0 through 1,000 purpose-bound properties — unconstrained RFC 8259 JSON items.

Output schema

FieldTypeRequiredDescription
statementTypestringYesParsed SQL statement type.
tablesarrayYesBounded table-reference receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
ctesarrayYesBounded common-table-expression receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
columnsarrayYesBounded resolved column-reference receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
writesarrayYesBounded write-target receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
hasWildcardbooleanYesWhether a wildcard column selection appears.
unresolvedColumnsarrayYesBounded unresolved column receipts. The item shape is defined by the nested schema and the array contains from 0 through 100000 items.
findingsarrayYesBounded array of safe structured database findings. The item shape is defined by the nested schema and the array contains from 0 through 20000 items.
_metaobjectYesClosed extraction metadata receipt. Its documented receipt properties are bounded to 128 entries — unconstrained RFC 8259 JSON items.

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_extract_tables","input":{"sql":"SELECT 1","dialect":"postgresql"}}'
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_extract_tables", {"sql":"SELECT u.name FROM users u JOIN orders o ON o.user_id = u.id","dialect":"postgresql"});

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_PARSE_FAILED400NoThe request payload failed this skill's input validation.
SQL_DIALECT_UNSUPPORTED400NoThe skill does not support the requested variant.
SQL_REFERENCE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
SQL_PARSE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not resolve schemas or expand wildcards
  • Does not prove read-only intent at runtime
  • Does not build full column lineage graphs
  • Schema-qualified column expansion
  • Semantic data lineage across pipelines

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "database.sql_extract_tables",
  "input": {
    "sql": "SELECT u.name FROM users u JOIN orders o ON o.user_id = u.id",
    "dialect": "postgresql"
  }
}

Examples

Join lists both source tables with no writes

Inputjson
{
  "sql": "SELECT u.name FROM users u JOIN orders o ON o.user_id = u.id",
  "dialect": "postgresql"
}
Expected outputjson
{
  "unresolvedColumns": [],
  "statementType": "SELECT",
  "writes": [],
  "tables": [
    {
      "name": "orders",
      "access": "READ",
      "role": "SOURCE"
    },
    {
      "name": "users",
      "access": "READ",
      "role": "SOURCE"
    }
  ],
  "columns": [],
  "findings": [],
  "ctes": [],
  "_meta": {
    "referenceCount": 2,
    "resolveAliases": true,
    "parserProfile": "jsqlparser-5.3"
  },
  "hasWildcard": false
}

Insert surfaces the write target

Inputjson
{
  "sql": "INSERT INTO audit_log (msg) VALUES ('x')",
  "dialect": "postgresql"
}
Expected outputjson
{
  "unresolvedColumns": [],
  "statementType": "INSERT",
  "writes": [
    {
      "name": "audit_log",
      "access": "WRITE"
    }
  ],
  "tables": [
    {
      "name": "audit_log",
      "access": "WRITE",
      "role": "TARGET"
    }
  ],
  "columns": [],
  "findings": [],
  "ctes": [],
  "_meta": {
    "referenceCount": 1,
    "resolveAliases": true,
    "parserProfile": "jsqlparser-5.3"
  },
  "hasWildcard": false
}
  • Gate read-only agents by checking the writes array is empty
  • Inventory tables touched by a migration script
  • Pre-flight review before granting query access

Avoid for

  • Schema-qualified column expansion
  • Semantic data lineage across pipelines

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

tablessqlparsingdatabase