Missing data and explicit null share NULL. This does not infer defaults or NOT NULL constraints.
PostgreSQL quoted names and backslashes
Quotes inside table and column names are doubled. The path containing a backslash uses an E literal; its apostrophe is doubled and the boolean is TRUE.
Nested paths map to the same column. Rename keys or turn flattening off.
Turn flattening off or change keys to resolve the collision; the same check applies across rows.
Map API payloads to INSERT drafts
Paste JSON, set one table name, choose a dialect and check the flatten option. Columns follow the first encountered keys across rows; missing fields and explicit null both become SQL NULL. Copy or download the draft after reviewing it.
MySQL identifiers use backticks; PostgreSQL and SQLite use double quotes. Identifier quotes are doubled. A table name such as public.users is quoted as one name, not a schema-qualified path. No CREATE TABLE, database connection or parameter binding is generated.
Usage Boundaries & Limitations
Flattening joins nested object keys with underscores. Arrays remain JSON text; with flattening off, objects also remain JSON text. Distinct paths that produce the same column are rejected, including across rows. Empty nested objects contribute no columns.
Single quotes are doubled in strings. MySQL backslashes are doubled for the usual backslash-escape mode; NO_BACKSLASH_ESCAPES needs a separate review. PostgreSQL uses an E-prefixed literal when a backslash occurs. SQLite keeps backslashes literal.
This is SQL text, not bound parameters or schema validation. Review target types, constraints, permissions and session settings. Application writes should use driver or ORM parameters. JSON text does not automatically become a database JSON column.
JSON.parse uses JavaScript numbers: large integers can lose precision before conversion. Non-finite numbers, actual NUL characters and inputs with no columns are rejected. Use strings for identifiers that must retain every digit.
A primitive root maps to value; primitive array entries also get their original index. Top-level arrays become rows, not related tables. Empty input clears the result; an empty array produces only a comment. Conversion and downloads require JavaScript.
Frequently Asked Questions (FAQ)
Does JSON to SQL create a relational schema?▼
No. It generates one INSERT statement for one quoted table name. It does not infer CREATE TABLE, column types, keys, indexes or relations.
What happens when flattening creates duplicate column names?▼
user_name and user.name both map to user_name. Conversion stops with an error, even when the paths occur in different rows. Rename the keys or turn flattening off, then review the new mapping.
How do the three dialects handle quotes and backslashes?▼
String quotes are doubled. MySQL also doubles backslashes for its usual escape mode; PostgreSQL uses E literals for strings with backslashes; SQLite retains backslashes. Review the MySQL session mode before running a draft.
Can I use these INSERT statements as parameterized application writes?▼
The tool outputs literal SQL, with no placeholders or separate bound values. Use your database driver or ORM parameter API for application writes, and check database types and constraints yourself.