Sql To Json API
https://api.findutils.com/api/tools/sql-to-json/execute Read rows out of SQL INSERT statements (mysqldump, SQLite dump, pg_dump made with --inserts; PostgreSQL COPY blocks are not read) and return JSON: an array of objects, or an object keyed by table when the dump holds rows for more than one table. The SQL is parsed as text — nothing is executed. Column names come from the INSERT column list, then from a CREATE TABLE in the same input, then from positions (column_1, column_2, ...). NULL becomes null, unquoted TRUE/FALSE become booleans, unquoted numbers become JSON numbers unless a double cannot hold them exactly (beyond ±9007199254740991 or more than 15 significant digits), in which case they stay strings. Quoted values stay strings; with coerce_numbers a quoted column becomes numbers only when every quoted value in that column writes back as the same text, so a column holding '007' stays all strings. Functions and keywords such as NOW() or DEFAULT are not evaluated: their SQL text is kept as a string and listed in notes. Hex and bit literals stay as text. An INSERT ... SELECT has no literal rows and is listed in skipped rather than guessed at.
Request body
application/json-
sql
string required
SQL dump text containing INSERT statements.
-
group_by_table
string optional
'auto' returns an object keyed by table only when more than one table has rows; 'always' always keys by table; 'never' returns one flat array. One of
auto · always · never. Default"auto". -
coerce_numbers
boolean optional
Turn QUOTED numbers into JSON numbers, decided per column: a column converts only when every quoted value in it is a canonical number (such as '42' or '-3.5'), so a column holding '007', '1.50', '+3' or '1e5' stays all strings. Unquoted numbers are always numbers. Default
true. -
include_table_key
boolean optional
In a flat array, add a "__table" field naming each row's table. Ignored when grouped. Default
false. -
indent
integer optional
Spaces of indentation in the json string. 0 gives minified output. One of
0 · 2 · 4. Default2. -
table
string optional
Return only this table. Default: every table found.
-
max_rows
integer optional
Stop after this many rows per table. Default 50000, maximum 200000. Default
50000.
Example arguments
Verified{
"sql": "INSERT INTO people (id, name, active) VALUES (1, 'Ada', TRUE), (2, NULL, FALSE);"
} More Data tools
- Api Docs Generator Return API documentation generated from a list of endpoints, as Markdown (with table of contents, request/response examples) or as an OpenAP
- Bookmarks Html To Csv Convert a browser bookmarks.html export from Chrome, Firefox, Edge, Safari or any other browser that writes the Netscape bookmark format int
- Bookmarks Json To Html Convert a bookmarks JSON file into a Netscape bookmarks.html that Chrome, Firefox, Edge and Safari import.
- Csv Dedupe Remove duplicate rows from a CSV or TSV table.
- Csv Diff Compare two CSV or TSV tables by key column and list the rows that were added, removed or changed - a table diff, not a line diff, so rows i
- Csv To Bookmarks Html Convert a CSV of links into a Netscape bookmarks.html file that Chrome, Firefox, Edge and Safari import.