Vai al contenuto principale
CuteJSON
↑↓ Naviga Enter Seleziona Esc Chiudi

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.

Torna a tutti gli strumenti

Scorciatoie da tastiera

Funzionano dove l'azione corrispondente esiste in questa pagina.

Apri la tavolozza comandi
Ctrl/Cmd + K
Esegui l'azione principale
Ctrl/Cmd + Enter
Formatta
Ctrl/Cmd + Shift + F
Minifica
Ctrl/Cmd + Shift + M
Copia output
Ctrl/Cmd + Shift + C
Apri file
Ctrl/Cmd + Shift + O
Scarica output
Ctrl/Cmd + S
Chiudi questa finestra
Esc
Apri questa finestra
F1 / ?

Dati locali

Tutto qui sotto e memorizzato solo in questo browser.

Bozze non salvate
Strumenti con opzioni ricordate

File aperti di recente

    Nessun file aperto ancora.

    Condividi via link

    Il contenuto e impacchettato nella parte dopo il #.

    Condivide la prima input in questa pagina.

    Niente da condividere ancora.

    Input

    Carica da un URL

    Recupera l'URL dal tuo browser.

    Output

    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

    1. Paste your JSON on the left, or load the sample.
    2. Choose a dialect, a table name, and any options, then press Convert.
    3. Copy the result or download it as a file.