Extract SQL INSERT values into a JSON fixture
Reuse the data in a small seed script without connecting to or executing queries on a database.
- Read INSERT values into a table
SQL to CSV
- Use the column names as JSON keys
CSV to JSON
Run both steps
What to check in the example
The sample inserts three items into stock. In the JSON output, look for B04 with the item Pens, blue and units equal to the string 8.
Download the source exampleWorking with your own file
Supply supported INSERT statements for the same table with explicit column names. SELECT queries and database dumps are outside this workflow.