Skip to content

[FORMATTING] PostgreSQL TYPE keyword used as identifier causes indentation errors #685

@karlhorky

Description

@karlhorky

Input data

Which SQL and options did you provide as input?

SELECT
  items.id,
  'project' AS type,
  items.created_at,
  items.modified_at
FROM
  items;

Expected Output

(no formatting change)

SELECT
  items.id,
  'project' AS type,
  items.created_at,
  items.modified_at
FROM
  items;

Actual Output

TYPE keyword causes subsequent lines to move down without indentation

SELECT
  items.id,
  'project' AS
type,
items.created_at,
items.modified_at
FROM
  items;

Usage

  • How are you calling / using the library? Website demo
  • What SQL language(s) does this apply to? PostgreSQL
  • Which SQL Formatter version are you using? 14.0.0

Hypothesis

Maybe the '[SET DATA] TYPE' array item in onelineClauses or the 'TYPE' keyword have something to do with it

Related issues

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