back arrow

Remove column in a sql insert

06 - 08 - 2022

So a couple of days ago I were assigned a task of editing seed data for our database. First I got the data from a mysql database and exported it insql file format. Then I needed to edit the sql file since we had decided to remove unnecessary column in the old mysql table for leaner code and a bit smaller storing space. Finally I run hasura seed apply to add the data to our postgres database.

The tasks are obvious, but it took me a few hours to edit all the sql files with its INSERT statement. The reason is that I had to write script to process string from sql files. So to help myself and perhaps other people to save their time, I copied my script, put it to an vscode extension, and published it to the marketplace. It’s name is rm-col-sql-insert (Yeah I know it’s a terrible name!).

Link to the vscode marketplace: remove column sql insert

How to use how to use