▲ | mritchie712 3 months ago | |||||||
a fun function in duckdb (which I think they're using here) is `json_serialize_sql`. It returns a JSON AST of the SQL
| ||||||||
▲ | hamilton 3 months ago | parent | next [-] | |||||||
Indeed, we are! We worked with DuckDB Labs to add the query_location information, which we're also enriching with the tokenizer to draw a path through the AST to the cursor location. I've been wanting to do this since forever, and now that we have it, there's actually a long tail of inspection / debugging / enrichment features we can add to our SQL editor. | ||||||||
▲ | krferriter 3 months ago | parent | prev | next [-] | |||||||
This is a very cool feature. I don't know how useful it is or how I'd use it right now but I think I am going to get into some benchmarking and performance tweaking soon and this could be handy. | ||||||||
▲ | RobinL 3 months ago | parent | prev [-] | |||||||
Can you go the other way? (E.g. edit the above and turn it back into SQL string) I've used sqlglot to do this in the past, but doing it natively would be nice | ||||||||
|