sql-formatter-org / sql-formatter-org/sql-formatter

[FORMATTING] Allow dense formatting of multiple square brackets after another

Open
#489 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug postgresql snowflake
Dominant language
TypeScript
Stars
2.9k
Forks
456
Avg merge
3d 4h
Merged PRs (30d)
3

Description

Input data

Which SQL and options did you provide as input?

select foo['bar']['baz']['boz']

Expected Output

select
  foo['bar']['baz']['boz']

Actual Output

select
  foo['bar'] ['baz'] ['boz']

Usage

  • How are you calling / using the library?
    • I used the demo website
  • What SQL language(s) does this apply to?
    • I tested with Snowflake and Postgresql
  • Which SQL Formatter version are you using?
    • The latest one.

Infos

This is not breaking, afaik it works with spaces in between as well. However it looks a bit weird, so maybe we can figure this out?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported SQL in the demo website or formatter entry point, comparing the expected and actual spacing around chained square-bracket expressions. Trace the formatting path for consecutive brackets and add coverage for the Snowflake and PostgreSQL examples if the test location is identified. Done means the brackets remain dense without spaces between them.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, sql, typescript
Domain
databases, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.