Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deparser does not handle MergeWhenClause #292

Open

Description

import { parse, deparse } from 'pgsql-parser';
const sql = `MERGE INTO t AS target
 USING (SELECT 1 AS id) AS source ON target.id = source.id
 WHEN MATCHED THEN UPDATE SET name = 'x'
 WHEN NOT MATCHED THEN INSERT (id, name) VALUES (source.id, 'x')`;
const ast = parse(sql); // succeeds
deparse(ast); // throws: does not handle node type: MergeWhenClause

The parser handles MERGE (added in PostgreSQL 15) but the deparser has no visitor for MergeWhenClause. Tested on pgsql-deparser@17.18.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /