sqlc
sqlc copied to clipboard
Allow errors returned by queries to be wrapped with method name information
What do you want to change?
Free unicorns! And...
Currently, when I use a bunch of query methods (like q.SelectUnicorns()) and then just do the usual if err!=nil { return err }, then I'll have a hard time figuring out which of those caused the SQL error.
Therefore, I typically do
err := q.SelectUnicorns()`
if err!= nil {
return fmt.Errorf("SelectUnicorns %w", err)
}
It would be nice if there was a feature toggle to enable this wrapping right within the generated code.
What database engines need to be changed?
No response
What programming language backends need to be changed?
Go