Convert JSON to SQL
Turn JSON files into SQL. SQL in SQLite's dialect that creates one table named data with a row per object, its columns typed by DuckDB, and inserts every row, as SQLite's .dump writes it inside one transaction, so MySQL and PostgreSQL do not run it as it is.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop JSON files on the dialor turn it to pick what to do
A SQL script that rebuilds your JSON as a table.One table named data, with a row for each object and an insert for every row.
What you get
A SQL script in SQLite's dialect. It creates one table named data and inserts every row into it. Each object in the JSON becomes one row.
The columns are typed by DuckDB. The script is laid out as SQLite's .dump writes it, with everything inside one transaction.
What changes
Decimals keep every digit SQLite stores, so 41.7 comes out as 41.700000000000002842. The value is the same number SQLite holds, written out in full.
The script is written for SQLite. MySQL and PostgreSQL do not run it as it is.
Going the other way
To turn a SQL script back into JSON, use SQL to JSON. For other JSON conversions, see every JSON conversion.
JSON and SQL.What each format is.
The formats
JSON
JSON, the data format of every API.
- Extensions
- .json
- MIME type
- application
/json - Kind
- Text and data
SQL Script
SQL statements as text. A database dump that any SQL tool can read or replay.
- Extensions
- .sql
- MIME type
- application
/sql - Kind
- Text and data
In your code.The same JSON to SQL conversion through the API, for your app or your agent.
$ cv convert report.json report.sql$ cv convert report.json report.sqlQuestions.What people ask about JSON to SQL.
SQLite. The script uses SQLite's dialect, so MySQL and PostgreSQL do not run it as it is.
The table is named data. There is one table, and it holds every row.
Decimals keep every digit SQLite stores. The longer number is how SQLite holds 41.7.
Yes. Each object in the JSON becomes one row in the data table, and every row is inserted.