Skip to content

Add line number to error message when executing blob of sql #1326

@jbeder

Description

@jbeder

I'm running a blob of sql line this:

if _, err := db.ExecContext(ctx, statement); err != nil {
  return err
}

and I'm getting FOREIGN KEY constraint failed; but it's a giant blob of sql with many insert statements, so I sorta have to do trial and error to figure out which constraint is failing. Is it possible to add a line number to this error message?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions