How to convert json to postgresql insert statements
- Step 1Provide a JSON array of record objects — Each object in the array becomes one row. Keys become column names in the INSERT statement. Ensure all objects have the same keys, or handle missing keys with a default value.
- Step 2Set the target table name — Enter the PostgreSQL table name in the options panel. If the table uses a schema prefix, use schema.table_name format — for example public.products or inventory.categories.
- Step 3Choose columns to include or exclude — If the JSON contains keys that do not map to table columns (like internal _id fields or computed properties), use the column filter to exclude them from the INSERT statement.
- Step 4Copy or download the SQL and run with psql — Copy the output SQL and run it with psql -U postgres -d mydb -c '<sql>', or save as seed.sql and run psql -U postgres -d mydb -f seed.sql to execute the entire file.
Frequently asked questions
How are JSON arrays and objects inside records handled in the INSERT?+
Nested JSON objects and arrays are serialized as PostgreSQL JSONB literals — wrapped in single quotes and cast with ::jsonb. This works for any column defined as json or jsonb in PostgreSQL and allows you to store nested data in a single column.
Should I use INSERT with ON CONFLICT for idempotent seeding?+
For seed scripts that are run multiple times (e.g. in development environments), use INSERT INTO table (...) VALUES (...) ON CONFLICT (id) DO NOTHING to prevent duplicate key errors. Enable the 'Add ON CONFLICT' option in the tool to append this clause automatically.
Is the seed data — including any PII in test fixtures — transmitted to JAD Apps?+
No. SQL generation runs entirely in your browser. Test data, user records, and any sensitive values in the JSON are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.