Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Fix PostgreSQL 17 Deparser Support

Summary

Fixed failing deparser test in misc-issues.test.ts by implementing support for PostgreSQL 17 features, specifically the NULLS NOT DISTINCT constraint syntax.

Changes Made

  • Fixed UNIQUE constraint deparser: Added support for nulls_not_distinct property in the UNIQUE constraint handler in deparser.ts
  • Created TESTS.md: Added test results documentation showing 254/254 tests passing (100%)

Technical Details

The issue was in the visitConstraint method where the deparser wasn't handling the nulls_not_distinct property for UNIQUE constraints. Added a conditional check to output "NULLS NOT DISTINCT" when this property is true.

Test Results

  • Before: 253/254 tests passing (99.6%)
  • After: 254/254 tests passing (100%)

All PostgreSQL 17 features in the misc-issues test now work correctly:

  • GENERATED BY DEFAULT AS IDENTITY columns
  • UNIQUE NULLS NOT DISTINCT constraints

Verification

cd packages/deparser
yarn test --testNamePattern="misc-issues"  # ✅ PASS
yarn test  # ✅ 254/254 tests passing

Link to Devin run

https://app.devin.ai/sessions/e2a49c9a83094092a217b1c66ad778de

Requested by: Dan Lynch ([email protected])

- Add support for nulls_not_distinct property in UNIQUE constraint handler
- Resolves AST mismatch issues in misc-issues test for PostgreSQL 17 features
- All 254/254 deparser tests now passing (100%)

Co-Authored-By: Dan Lynch <[email protected]>
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