Skip to content

Allow errors returned by queries to be wrapped with method name information #1612

Open
@Hades32

Description

@Hades32

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions