4 ms·
The hasql-th[0] package implements an sql parser to give better error messages, here's an example: Consider the following broken statement: select 1 from a wh
by ParetoOptimal 4y ago
The hasql-th[0] package implements an sql parser to give better error messages, here's an example:
Consider the following broken statement:
select 1 from a where b >= 3 && b < 4
It is incorrect, because it uses && instead of and. But here's what Postgres' original parser says about it:
ERROR: syntax error at or near "<"
LINE 1: select 1 from a where b >= 3 && b < 4;
^
Here's what "hasql-th" says:
|
2 | select 1 from a where b >= 3 && b < 4;
| ^
unexpected '&'
0: https://github.com/nikita-volkov/hasql-th#error-example-1 https://github.com/nikita-volkov/hasql-th#error-example-1