Skip to content

Live Demos & Playground

Welcome to the General SQL Parser Live Demos! Test the parsing capabilities of GSP directly in your browser with real-time results and interactive visualizations.

🚀 Quick SQL Playground

Try parsing any SQL statement instantly. Select your database vendor and see the results in real-time.

🎯 Specialized Demos

Explore specific aspects of SQL parsing with our specialized interactive demos:

🔍 SQL Playground

Comprehensive SQL parsing environment - Multi-database support (25+ vendors) - Real-time syntax validation - Advanced parsing options - Export results in multiple formats

🌳 AST Explorer

Visual Abstract Syntax Tree exploration - Interactive tree visualization - Node inspection and details - AST manipulation tools - Code generation from AST

⚖️ Database Comparison

Cross-database parsing comparison - Parse same SQL across different databases - Highlight vendor-specific differences - Compatibility analysis - Migration assistance tools

💼 Use Cases

Real-world examples and applications - Code migration scenarios - Query optimization examples - Data lineage analysis - Integration patterns

Try these commonly used SQL patterns:

Complex JOIN Query

SELECT u.username, p.title, c.content FROM users u LEFT JOIN posts p ON u.id = p.user_id LEFT JOIN comments c ON p.id = c.post_id WHERE u.active = 1 ORDER BY p.created_at DESC;

Window Functions

SELECT employee_id, department_id, salary, AVG(salary) OVER (PARTITION BY department_id) as dept_avg, RANK() OVER (ORDER BY salary DESC) as salary_rank FROM employees;

CTE with Recursion

WITH RECURSIVE employee_hierarchy AS ( SELECT id, name, manager_id, 1 as level FROM employees WHERE manager_id IS NULL UNION ALL SELECT e.id, e.name, e.manager_id, eh.level + 1 FROM employees e JOIN employee_hierarchy eh ON e.manager_id = eh.id ) SELECT * FROM employee_hierarchy;

Subquery with Aggregation

SELECT customer_id, customer_name, (SELECT COUNT(*) FROM orders o WHERE o.customer_id = c.customer_id) as order_count, (SELECT MAX(order_total) FROM orders o WHERE o.customer_id = c.customer_id) as max_order FROM customers c WHERE customer_id IN ( SELECT customer_id FROM orders GROUP BY customer_id HAVING COUNT(*) > 5 );

🔧 API Integration

All demos use the same REST API that you can integrate into your applications:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Parse SQL via REST API
curl -X POST https://api.sqlparser.com/parse \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "SELECT * FROM users WHERE active = 1",
    "database": "oracle",
    "options": {
      "format": "json",
      "includeAst": true
    }
  }'

Response:

1
2
3
4
5
6
7
8
{
  "success": true,
  "statementType": "SELECT",
  "tables": ["users"],
  "columns": ["users.active"],
  "ast": { ... },
  "formatted": "SELECT *\nFROM users\nWHERE active = 1"
}

📚 Getting Started

  1. Try the Quick Playground above with your own SQL
  2. Explore specialized demos for deep-dive features
  3. Check our tutorials for integration guidance
  4. Read the API documentation for programmatic access

🎓 Learning Path

New to SQL Parsing? Follow this recommended path:

  1. 📖 Getting Started Tutorial
  2. 🧪 Try the Quick Playground (above)
  3. 🔍 SQL Playground for comprehensive testing
  4. 🌳 AST Explorer for understanding structure
  5. 📚 Reference Documentation for detailed API

Parse Status: ${result.success ? '✅ Success' : '❌ Failed'}
Tables Found: ${result.tables ? result.tables.length : 0}
Columns Found: ${result.columns ? result.columns.length : 0}
`; // Display tables document.getElementById('demo-tables').innerHTML = result.tables ? result.tables.map(table => `
📋 ${table}
`).join('') : '
No tables found
'; // Display columns document.getElementById('demo-columns').innerHTML = result.columns ? result.columns.map(column => `
📊 ${column}
`).join('') : '
No columns found
'; // Display AST document.getElementById('demo-ast').innerHTML = `
${JSON.stringify(result.ast, null, 2)}
`; // Display formatted SQL document.getElementById('demo-formatted').innerHTML = `
${result.formatted || 'Formatting not available'}
`; } function initializeExampleCards() { document.querySelectorAll('.example-try-btn').forEach(btn => { btn.addEventListener('click', () => { const sql = btn.getAttribute('data-sql'); document.getElementById('demo-sql').value = sql; document.getElementById('demo-sql').scrollIntoView({ behavior: 'smooth' }); }); }); } function initializeTabs() { document.querySelectorAll('.demo-tab').forEach(tab => { tab.addEventListener('click', () => { const tabName = tab.getAttribute('data-tab'); // Remove active class from all tabs and panels document.querySelectorAll('.demo-tab').forEach(t => t.classList.remove('active')); document.querySelectorAll('.demo-tab-panel').forEach(p => p.classList.remove('active')); // Add active class to clicked tab and corresponding panel tab.classList.add('active'); document.getElementById(`tab-${tabName}`).classList.add('active'); }); }); }