Closed acarl005 closed 2 years ago
this looks amazing! I checked it out and all seems great and tests passing.
thanks for this @acarl005 — this will be super helpful. I think I may want to try adding this into https://github.com/pyramation/postgres-ast-deparser which has the same test env
This is my followup to #80. This PR makes the following cases easier to debug:
1. A syntax error trying to parse a SQL fixture file.
Before
Vague message like "syntax error at or near FROM"
After
Show exact line and column
2. Test failures b/c deparsing produces non-equivalent SQL
Before
Giant diff with potentially thousands/tens-of-thousands of lines of JSON AST
After
Diff for a single statement, as well as the before-deparsing and after-deparsing of the SQL statements
Note that the snapshots changed a lot since I'm checking statements 1-at-a-time now. However, this PR doesn't actually include any changes to the content of the tests or library functionality.