MySQL Reserved Words Almost Ruined My Weekend
Picture this: you export a MySQL dump, try to import it on another server, and it blows up. Why? Because someone (me, years ago) named a column status. Or order. Or key. You know, words that MySQL decided are sacred.
The fix is simple — wrap those column names in backticks. The annoying part is doing it manually on a 500MB dump file. No thanks.
So I built clean-sql. You point it at a SQL dump file, it finds the reserved words used as column names in INSERT...SET statements, wraps them in backticks, and saves the file. That’s it. Nothing fancy.
Could I have written a sed one-liner? Maybe. Would it have worked on edge cases? Absolutely not. I’ve been programming since 1988, I know better than to trust regex with SQL.
Built it in Go. Runs in seconds even on huge files.