SQL to JSON Output Simulator
Sketch mock JSON result sets from SQL-like input.
Overview
The SQL-to-JSON output simulator takes a SQL-like query and a column-type hint, and produces a plausible JSON array that the query might return. It's a sketch tool for mocking API responses, building wireframes, or filling in fixtures before the real database is ready.
Frontend developers, technical writers, and prototypers reach for a sql mock generator when they need a realistic result set but the backend isn't wired up yet. It's faster than typing out fixture JSON by hand and gives the frontend something concrete to render against.
How it works
The generator parses the SELECT column list and LIMIT clause to determine the shape of the output. For each column, it consults the type hint (int, string, email, name, date, bool, uuid, phone) and emits a synthetic value drawn from a small built-in dictionary or a random generator.
The number of rows defaults to 10 or whatever LIMIT specifies. The same seed produces the same output, so paste-and-go is reproducible — useful when you want stable fixtures across runs. WHERE clauses are not evaluated against the synthetic data; this tool generates shape, not semantics.
Examples
SELECT id, name, email FROM users LIMIT 3
[
{ "id": 1, "name": "Alice Liddell", "email": "alice@example.com" },
{ "id": 2, "name": "Bob Ross", "email": "bob@example.com" },
{ "id": 3, "name": "Carol Danvers", "email": "carol@example.com" }
]
SELECT order_id, total, status FROM orders LIMIT 2
[
{ "order_id": "550e8400-e29b-41d4-a716-446655440000", "total": 42.99, "status": "paid" },
{ "order_id": "9f8e7d6c-5b4a-3210-fedc-ba9876543210", "total": 17.50, "status": "pending" }
]
FAQ
Does it actually run the SQL?
No — it doesn't connect to a database, parse complex joins, or evaluate WHERE clauses. It uses the SELECT list and LIMIT to shape a mock array. For real data, run the query in your database client.
How do I control the data types?
Annotate columns with a hint comment, or pick types in the UI for each column. Email, name, UUID, and phone produce realistic-looking fake values; generic int and string produce simple sequences.
Can I produce nested objects?
The mock generator targets flat tabular results — that's what SQL returns. For nested shapes, mock the JSON directly or pipe a flat result through a transformer.