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

Feature request: Support for delimiter

Open
#184 27 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi, thank you for creating such a great library.
It would be great if there is an option that we can specify the delimiter so that the formatter can ignore formatting it.
With current formatter, with the following sql text

DELIMITER //

CREATE FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
  DECLARE x TINYINT;
  SET x = 42;
  RETURN x;
END 
//

DELIMITER ; 

It returns this

DELIMITER / /
CREATE
   FUNCTION FortyTwo() RETURNS TINYINT DETERMINISTIC
BEGIN
   DECLARE x TINYINT;

SET x = 42;

RETURN x;

END / / DELIMITER;

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

Start from the formatter entry point and review how the current formatting behavior handles DELIMITER directives and the routine example shown in the issue. Define the expected preserved delimiter syntax and verify the example input produces the intended output; the payload names no specific file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
databases, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.