About json to sql converter
Turn a JSON array into CREATE TABLE and INSERT statements for MySQL, PostgreSQL or SQLite.
Column types
Types are guessed from the values. Check them, because a column that is a number in the first rows may hold text later.
Back up before you run SQL
Review generated statements, run them on a test database first and keep a backup. UPDATE and DELETE without a WHERE clause affect every row. Values pasted into SQL by hand can also open the door to SQL injection, so use parameterised queries in application code.
A worked example
The array [{"id":1,"name":"Asha"},{"id":2,"name":"Ravi"}] becomes CREATE TABLE users (id INT, name VARCHAR(255)) and one INSERT with both rows. Check the guessed column types and add a primary key before running it.
Escaping
Single quotes inside strings are doubled, as in 'O''Brien', so the statements run correctly. Check large numbers and decimals, which need suitable column types.
