SQL Parse API - Extract Tables, Columns, and Clauses
Detects query type (SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP), extracts table names from FROM/JOIN/INTO/UPDATE clauses, extracts columns from the SELECT list (resolving AS aliases), and reports boolean flags for WHERE, JOIN, and subquery presence.
Code examples
curl -X POST https://api.botoi.com/v1/sql/parse \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT u.id, u.email FROM users u JOIN accounts a ON a.user_id = u.id WHERE u.active = TRUE"}'When to use this API
Auto-generate permission checks
Before running a user-supplied query, parse it and verify every referenced table is in the user's allowed list. Block queries that touch restricted tables without running them.
Query impact analysis
When refactoring a database, parse every query in your codebase and grep for a table being renamed. Lists every call site to update.
Classify queries for metrics
Aggregate slow-query logs by type (SELECT vs INSERT) and table. Quickly identify whether a performance issue sits in reads or writes and which tables dominate.
Frequently asked questions
What query types are recognized?
How are aliases handled in columns?
Are schema-qualified tables preserved?
Does the parser build a full AST?
What does has_subquery mean?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.