test(plpgsql-deparser): add schema transform demo test with fixture-based snapshots #268
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.
test(plpgsql-deparser): add schema transform demo test with fixture-based snapshots
Summary
Adds demonstration tests showing how to use the heterogeneous AST transformation pipeline for schema renaming in PL/pgSQL functions. The tests demonstrate the full pipeline:
Two test files are included:
schema-transform.demo.test.ts- 4 inline test cases covering common patterns (simple SELECT, trigger INSERT, RETURN QUERY, function calls in expressions)schema-rename-mapped.test.ts- Fixture-based snapshot test that:__fixtures__/plpgsql/plpgsql_schema_rename.sql(12 complex procedures)The rename map snapshot shows 41 total references across 3 schemas:
app_public: 39 references (functions, tables, relations, func_calls)app_private: 1 referenceapp_internal: 1 referenceReview & Testing Checklist for Human
walk()APIs - the demo uses manual recursion for clarity but production code may want to use the existing infrastructureexpect(output).not.toMatch(/\bapp_public\./)is the right approach for avoiding substring false positives (e.g., "myapp_public" contains "app_public")Test plan:
Notes
__fixtures__/plpgsql/so it can be incorporated into generated tests