Conversor de SQL para JSON

Precisa da conversão inversa?
JSON to SQL Converter

Entrada SQL

1

Saída JSON

Insira dados em SQL para convertê-los em JSON

Os dados convertidos aparecerão aqui

Como converter SQL para JSON

  1. Etapa 1 – Cole INSERTs SQL

    • Cole instruções INSERT INTO tabela (colunas) VALUES (valores); do seu dump ou exportação SQL.
    • A ferramenta suporta múltiplos INSERTs separados por ponto e vírgula.
    • Você também pode importar um arquivo .sql do seu computador.
  2. Etapa 2 – Revise a conversão

    • A ferramenta analisa a sintaxe SQL, extrai nomes de colunas como chaves e valores como dados.
    • Inteiros, booleanos (TRUE/FALSE) e NULL são convertidos para equivalentes em JSON.
    • Cada registro inclui um campo _table indicando a tabela de origem.
  3. Etapa 3 – Exporte o JSON

    • Copie o array JSON formatado para APIs ou arquivos de configuração.
    • Baixe o resultado como arquivo .json.
    • Se precisar do processo inverso, use as ferramentas relacionadas para converter JSON de volta para SQL.
Example: SQL to JSON
// Input SQL
INSERT INTO users (id, role) VALUES (1, 'admin');

// Output JSON
[
  {
    "id": 1,
    "role": "admin",
    "_table": "users"
  }
]

Related tools

Perguntas Frequentes

What SQL statements are supported?

Currently supports INSERT INTO statements with a VALUES clause. Each INSERT statement becomes a JSON object with column names as keys and the table name stored in a _table field.

How are SQL data types converted?

NULL → null, quoted strings → strings, numbers → numbers, TRUE/FALSE → booleans. Complex values are treated as strings and may need additional parsing.

Can I process multiple INSERT statements?

Yes. The converter processes all INSERT statements in the input and creates an array of JSON objects, one for each INSERT statement.

What about other SQL statements?

Currently only INSERT statements are supported. CREATE TABLE, SELECT, UPDATE, and DELETE statements are not processed but won't cause errors.

Is my data secure?

Yes, all data processing happens entirely in your browser. Your data is never sent to any server, ensuring complete privacy and security.

Conversor de SQL para JSON | JSONSwiss