Skip to content

Commit 45f0515

Browse files
committed
Fix NULLS NOT DISTINCT constraint deparser support
- 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]>
1 parent 465aabf commit 45f0515

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

TESTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Test Results
2+
3+
## Deparser Tests
4+
5+
**254/254 tests passing (100%)**
6+
7+
All deparser tests are now passing successfully, including the PostgreSQL 17 features:
8+
- GENERATED BY DEFAULT AS IDENTITY columns
9+
- UNIQUE NULLS NOT DISTINCT constraints
10+
11+
The deparser has been updated to properly handle these new PostgreSQL 17 syntax features.

packages/deparser/src/deparser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,9 @@ export class Deparser implements DeparserVisitor {
23562356
break;
23572357
case 'CONSTR_UNIQUE':
23582358
output.push('UNIQUE');
2359+
if (node.nulls_not_distinct) {
2360+
output.push('NULLS NOT DISTINCT');
2361+
}
23592362
if (node.keys && node.keys.length > 0) {
23602363
const keyList = ListUtils.unwrapList(node.keys)
23612364
.map(key => this.visit(key, context))

0 commit comments

Comments
 (0)