feat: add pg-ast package (copy of @pgsql/utils without runtime schema) #250
+9,202
−5,570
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Creates a new
pg-astnpm package as a lightweight copy of@pgsql/utilsthat excludes the runtime schema functionality. This package provides PostgreSQL AST helper functions for building AST nodes programmatically.Key changes:
@pgsql/utilspackage structure topackages/pg-ast/scripts/pg-proto-parser.ts(runtimeSchema.enabled: false)runtime-schema.tsfrom the source files@pgsql/utilsif they need runtime schemaReview & Testing Checklist for Human
__test__/utils.test.tspass and don't depend on runtime-schema functionality@pgsql/utilsfor runtime schema is clear and accurateTest plan: Run
pnpm install && cd packages/pg-ast && npx tsc --noEmitto verify TypeScript compiles. Run tests withpnpm testin the pg-ast directory.Notes
The source files (
asts.ts,wrapped.ts) are auto-generated and were copied from@pgsql/utils. Thebuild:protoscript won't work standalone sincepg-proto-parseris a workspace dependency, but this shouldn't be an issue since the generated files are already in place.Link to Devin run: https://app.devin.ai/sessions/cc86c0f40d274912b1531258fdcdbdf1
Requested by: Dan Lynch (@pyramation)