Skip to content

[FORMATTING] Missing space/new line with DELIMITER #229

@inferrinizzard

Description

@inferrinizzard

<Transferred from inferrinizzard#72, inferrinizzard#73>

Describe the bug
When using a DELIMITER there is an erroneous output. Try to format the following code:

DELIMITER $$

CREATE PROCEDURE sp_name()
BEGIN
  -- statements
END $$

DELIMITER ;

Expected Output

DELIMITER $$
CREATE PROCEDURE sp_name()
BEGIN
    -- statements
END $$
DELIMITER ;

Actual Output
There is no new line after BEGIN, but most importantly there is no space or even better a new line after END $$ and a space after DELIMITER.

DELIMITER $$
CREATE PROCEDURE sp_name()
BEGIN -- statements
END $$DELIMITER;

Usage

  • How are you calling / using the script? (Please provide a code snippet, if applicable)
    prettier-sql -l mariadb -o with_delimiter.sql with_delimiter_formatted.sql
  • What SQL language(s) does this apply to?
    MariaDB, MySQL
  • What Node version?
    16

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