Skip to content

[FORMATTING] When the language is postgres, executing "select * from test. [User]" will result in an error message #719

@zbenj

Description

@zbenj

Input data

Which SQL and options did you provide as input?

select * from  test.[User] 

Actual Output

none result

Console Output

Uncaught Error: Parse error at token: [ at line 1 column 21
Unexpected OPEN_PAREN token: {"type":"OPEN_PAREN","raw":"[","text":"[","start":20}. Instead, I was expecting to see one of the following:

A LINE_COMMENT token based on:
    comment →  ● %LINE_COMMENT
    _$ebnf$1_$ebnf$1comment
    _ →  ● _$ebnf$1...

at Parser.feed (nearley.js:343:27)
    at Object.parse (createParser.ts:33:34)
    at Formatter.parse (Formatter.ts:41:49)
    at Formatter.format (Formatter.ts:33:22)
    at formatDialect (sqlFormatter.ts:94:57)
    at formatSqlValue (index.vue:193:23)
    at formatValue (index.vue:170:9)
    at callWithErrorHandling (runtime-core.esm-bundler.js:158:18)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:17)
    at SVGSVGElement.invoker (runtime-dom.esm-bundler.js:595:5)

Usage

  • How are you calling / using the library?
    import { formatDialect,sql,plsql,transactsql,postgresql } from 'sql-formatter'
    formatDialect(sqlVal, { dialect: postgresql})
  • What SQL language(s) does this apply to?
  • postgresql
  • Which SQL Formatter version are you using?
  • 13.0.4

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