3 ms·
(author here) Just realized that could use a more direct link (will add), here is the relevant section from our post on pg_query: https://pganalyze.com/blog/p
by lfittl 5y ago
(author here)
Just realized that could use a more direct link (will add), here is the relevant section from our post on pg_query:
https://pganalyze.com/blog/pg-query-2-0-postgres-query-parser#using-libclang-to-extract-c-source-code-from-postgres https://pganalyze.com/blog/pg-query-2-0-postgres-query-parse...
The quick summary: Call libclang using the Ruby FFI bindings to parse C code into AST and locate function/symbol definitions, build a tree
of dependent code, remove all code that is not referenced + add a few stubs where there is direct disk access.
- rad_gruchalski 5y agoThanks for that info. I was looking recently at extracting the parsing layer so this will be pretty interesting.
- tomnipotent 5y agoI believe DuckDB has also extracted the Postgres parser into a separate package.