3 ms·
At Splitgraph we integrated tree-sitter [0] (in WASM) into our Console query editor [1] to introspect the pgSQL query and display the referenced tables in the s
by voreny 3y ago
At Splitgraph we integrated tree-sitter [0] (in WASM) into our Console query editor [1] to introspect the pgSQL query and display the referenced tables in the sidebar for easier comprehension. We have written an article detailing how we got it done, where we evaluated a few existing pgSQL parsers, and talked about the parser features that are vital when using it in a code editor.
I was the lead engineer working on this feature and I'm here to talk more about this feature and answer any related questions you may have.
[0]: https://tree-sitter.github.io/tree-sitter/ https://tree-sitter.github.io/tree-sitter/
[1]: https://www.splitgraph.com/query?sqlQuery=SELECT%0A++++%22EmployeeId%22%2C%0A++++%22LastName%22%2C%0A++++%22FirstName%22%2C%0A++++%22Title%22%2C%0A++++%22ReportsTo%22%2C%0A++++%22BirthDate%22%2C%0A++++%22HireDate%22%2C%0A++++%22Address%22%2C%0A++++%22City%22%2C%0A++++%22State%22%2C%0A++++%22Country%22%2C%0A++++%22PostalCode%22%2C%0A++++%22Phone%22%2C%0A++++%22Fax%22%2C%0A++++%22Email%22%0AFROM%0A++++%22demodemo123%2Fchinook-from-sqlite%3A0df8bfcc3c837a68d20be83830af20781f6f6d4515ee0da60b06cc9850c31918%22.%22Employee%22%0ALIMIT+100%3B&id=006102fd-c5ef-47e7-ada3-40a7040006d6&flavor=splitgraph&initial-namespace=demodemo123 https://www.splitgraph.com/query?sqlQuery=SELECT%0A++++%22Em...