Pular para o conteudo principal
CuteJSON
↑↓ Navegar Enter Selecionar Esc Fechar

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.

Voltar para todas as ferramentas

Atalhos de teclado

Estes funcionam onde a acao correspondente existe nesta pagina.

Abrir a paleta de comandos
Ctrl/Cmd + K
Executar a acao principal
Ctrl/Cmd + Enter
Formatar
Ctrl/Cmd + Shift + F
Minimizar
Ctrl/Cmd + Shift + M
Copiar saida
Ctrl/Cmd + Shift + C
Abrir arquivo
Ctrl/Cmd + Shift + O
Baixar saida
Ctrl/Cmd + S
Fechar este dialogo
Esc
Abrir este dialogo
F1 / ?

Dados locais

Tudo abaixo e armazenado apenas neste navegador, neste dispositivo. Nada e enviado a lugar nenhum, e fechar este dialogo nao e necessario para que isso continue verdade.

Rascunhos nao salvos
Ferramentas com opcoes lembradas

Arquivos abertos recentemente

    Nenhum arquivo aberto ainda neste dispositivo.

    Compartilhar via link

    O conteudo e empacotado na parte do link apos o #, que navegadores nunca enviam a um servidor.

    Compartilha a primeira entrada nesta pagina.

    Nada para compartilhar ainda.

    Entrada

    Carregar de uma URL

    Busca a URL diretamente do seu navegador.

    Saida

    O resultado aparece aqui.

    Funciona inteiramente no seu navegador.

    Sobre esta ferramenta

    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.

    Como usar

    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.