Skip to content

Conversation

@pyramation
Copy link
Collaborator

@pyramation pyramation commented Jan 9, 2026

Summary

Adds regression tests to verify that PL/pgSQL functions containing SELECT INTO statements are correctly parsed and hydrated. These tests ensure SELECT INTO parsing continues to work correctly.

Tests added:

  • Parse function with SELECT INTO statement
  • Parse function with SELECT INTO and schema-qualified table
  • Deparse function with SELECT INTO correctly
  • Parse function with DELETE statement (contrast test showing other DML works)

Updates since last revision

Fixed test comments to accurately reflect that these are regression tests, not documentation of a bug. Removed misleading comments about parsing failures and placeholder issue URLs.

Review & Testing Checklist for Human

  • Verify tests pass: Run pnpm test in packages/plpgsql-parser to confirm all 96 tests pass
  • Review test coverage: Confirm the SELECT INTO test cases adequately cover the parsing scenarios needed

Notes

During investigation, there was initial confusion where tests run from /tmp with incorrect module paths produced errors that were mistaken for a bug in @libpg-query/parser. When tests were run correctly from within the package directory, SELECT INTO parsing worked fine. The tests are valuable as regression tests to ensure this continues to work.

Link to Devin run: https://app.devin.ai/sessions/f93a8b1ba9e54876a87e854e782a06ef
Requested by: Dan Lynch (@pyramation)

Add tests to verify that PL/pgSQL functions containing SELECT INTO
statements are correctly parsed and hydrated. These tests serve as
regression tests to ensure SELECT INTO parsing continues to work.

Tests added:
- should parse function with SELECT INTO statement
- should parse function with SELECT INTO and schema-qualified table
- should deparse function with SELECT INTO correctly
- should parse function with DELETE statement (contrast test)
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Update test comments to accurately describe that these are regression
tests to ensure SELECT INTO parsing continues to work, rather than
documenting a bug that no longer exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants