My journey to upgrade pgsql-parser to TypeScript led to an exciting discovery in the pganalyze/libpg_query repository: protobuf files defining PostgreSQL's AST. This discovery inspired me to create a proto-to-TypeScript transpiler, streamlining the process of typing the pgsql-parser and unlocking other cool new features :)<p>The transpiler not only allowed me to add typing for pgsql-parser but also spawned a suite of TypeScript utilities that are invaluable for PostgreSQL development.<p>Explore the tools:<p>pg-proto-parser: <a href="https://github.com/launchql/pg-proto-parser">https://github.com/launchql/pg-proto-parser</a>
pgsql-parser: <a href="https://github.com/launchql/pgsql-parser">https://github.com/launchql/pgsql-parser</a><p>Additionally, we now have new utilities generated by the proto parser, make sure to checkout the @pgsql/utils! That has some cool features in it:<p>@pgsql/enums: <a href="https://github.com/launchql/pgsql-parser/tree/main/packages/enums">https://github.com/launchql/pgsql-parser/tree/main/packages/...</a>
@pgsql/types: <a href="https://github.com/launchql/pgsql-parser/tree/main/packages/types">https://github.com/launchql/pgsql-parser/tree/main/packages/...</a>
@pgsql/utils: <a href="https://github.com/launchql/pgsql-parser/tree/main/packages/utils">https://github.com/launchql/pgsql-parser/tree/main/packages/...</a><p>Hope you enjoy! Please let me know anything you'd like to see!