sql-formatter-org / sql-formatter-org/sql-formatter
Incorrect indentation in PostgreSQL `DELETE FROM ... USING`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 456
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 3
Description
Describe the Feature
More consistent formatting for multiple joined tables after the USING keyword in a DELETE FROM ... USING query (consistent compared to SELECT ... FROM ... JOIN:
Input data
Which SQL and options did you provide as input?
DELETE FROM films
USING
producers,
sessions
WHERE sessions.id = '123' AND producer_id = producers.id AND producers.name = 'foo';
Expected Output
DELETE FROM
films
USING
producers,
sessions
WHERE
sessions.id = '123'
AND producer_id = producers.id
AND producers.name = 'foo';
Actual Output
DELETE FROM films USING producers,
sessions
WHERE
sessions.id = '123'
AND producer_id = producers.id
AND producers.name = 'foo';
Why do you want this feature?
To be more consistent with the SELECT ... FROM ... JOIN formatting:
SELECT
*
FROM
candidates
INNER JOIN sessions ON users.session_id = sessions.id
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named in the issue. Reproduce the provided DELETE FROM ... USING input and trace the formatter entry point for joined tables, comparing it with SELECT ... FROM ... JOIN handling; the work is done when the output matches the expected indentation without changing the WHERE formatting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100