adelsz / pgtyped

pgTyped - Typesafe SQL in TypeScript
https://pgtyped.dev
MIT License
2.92k stars 95 forks source link

Add file name to errors #526

Open timvandam opened 1 year ago

timvandam commented 1 year ago

Is your feature request related to a problem? Please describe. Pgtyped runs 6 threads in parallel whenever I run it, but this makes it hard to find out in which files errors are happening since they are all being processed in parallel. Adding the file name to errors would be great to prevent this.

When actively making a query this isn't really an issue, but I just changed my schema slightly and had to search through 29 .sql files

Describe the solution you'd like File name added to error logs

zacherkkila commented 10 months ago

This would be a fantastic add.. drives me crazy when I have many files and have to hunt down issues after a schema change

bbsimonbb commented 4 months ago

This is bugging us as well. This would be a big improvement.

domdinnes commented 3 months ago

Error messages currently look like this:

Error in query. Details: {
  errorCode: 'scanner_yyerror',
  hint: undefined,
  message: 'syntax error at or near "VALUES"',
  position: '124'
}

I'd like to see both the file and query name in the error message. As people above have mentioned - it makes tracking down problems difficult, especially after schema changes.