JSON to SQL Converter
Turn a JSON document into a CREATE TABLE statement and the INSERT statements to load it, for the dialect you actually run.
Input
Colorazione sintattica disattivata.
Output
Colorazione sintattica disattivata.
Il risultato appare qui.
Funziona interamente nel tuo browser.
Su questo strumento
Four SQL dialects, because CREATE TABLE and identifier quoting genuinely differ enough between them that picking one would be wrong for the other three. The document has to be an array of objects, or a single object as a one row table, the same shape the CSV converter accepts. Every column type is inferred by looking at every occurrence of that column across every record, not just the first one: a column falls back to a plain text column the moment two records disagree on its kind, a column that is always null gives nothing to infer from, and a nested object or array becomes either the dialect native JSON column type or a plain text column, your choice, since SQLite and SQL Server have no native JSON column type of their own either way. A column of pure integers gets its digit count checked against a safe range for a normal integer column; past that it gets a big or arbitrary precision decimal type instead, because a twenty digit id silently declared as a normal integer would silently overflow the moment the statement actually ran. Every identifier is quoted in the target dialect own style and every string is escaped for that dialect too, so the output is meant to run as written rather than be corrected by hand first. This produces SQL, not JSON, and no dialect reads SQL back into JSON, so this is one direction only, the same as the TypeScript and schema generators on this site.
Come usare
- Paste your JSON on the left, or load the sample.
- Choose a dialect, a table name, and any options, then press Convert.
- Copy the result or download it as a file.