When something breaks in production, the first thing I do is pull a SQL statement out of the logs and run it against the database myself.
What I actually get is this:
==> Preparing: SELECT id, username, status FROM user WHERE username = ? AND status = ? AND created_at > ? ==> Parameters: tom(String), 1(Integer), 2026-11-20 10:00:00.0(Timestamp)
Enter fullscreen mode
Exit fullscreen mode
Three placeholders, three values, and I have to line them up by hand. Add quotes to the string, reformat the timestamp, strip the type annotations. Doing this once is fine. Doing it fifteen times a day is not.
So I wrote a tool to do it for me. I assumed it would be a weekend of regex.…