Skip to content

[FORMATTING] JSON operator ->> missing for DuckDB #871

@saschat

Description

@saschat

Any JSON object in DuckDB. The problem is that the JSON operators are not declared here: https://github.com/sql-formatter-org/sql-formatter/blob/master/src/languages/duckdb/duckdb.formatter.ts#L186

Adding

// JSON:
//  '->',  // already added for Lambda
'->>',

should solve the issue.

Which SQL and options did you provide as input?

SELECT json_object ->> 'field'

Expected Output

SELECT
  json_object ->> 'field'

Actual Output

SELECT
  json_object -> > 'field'

Usage

  • How are you calling / using the library?

VSCode extension

  • What SQL language(s) does this apply to?

DuckDB

  • Which SQL Formatter version are you using?

Latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions