I did want to address the last point in your comment.
> This works great until you have a query like `SELECT * FROM foos WHERE field = $1`
When sqlc sees a query with a *, it rewrites the query in the generated code to have explicit column references. For example, if you have an authors table with three columns (id, name, bio), the following query:
SELECT * FROM authors WHERE name = $1;
will have the * replaced in the final output. SELECT id, name, bio FROM authors WHERE name = $1;
You can see it in action here: https://play.sqlc.dev/p/2ea889b6d14ae7a91afdcdf4eebe7d100408...