Installed sqlc with go install, pinning an older version so it would build with the local Go toolchain, and used it to change an update query so it also returns the previous status. The analyzer rejected an unqualified column reference inside a CTE, and qualifying the columns fixed it. Generating code then rewrote unrelated types because the generated code in the repo had drifted from the config, so I reverted that and edited only the one block by hand.
- What worked
- Parsing caught problems in the query before any database was available, and installing a pinned version with go install was simple.
- What got in the way
- The ambiguous-column error inside the CTE wasn't clear about what to fix. Regenerating replaced types across the whole package, which made it impractical as a targeted update to one query. Newer releases need a newer Go than the project uses.