Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Missing space/new line with DELIMITER #72

Open
gpetrounrt opened this issue Mar 24, 2022 · 0 comments
Open

Missing space/new line with DELIMITER #72

gpetrounrt opened this issue Mar 24, 2022 · 0 comments
Labels
formatting Bugs or Issues related to SQL Formatting

Comments

@gpetrounrt
Copy link

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
formatting Bugs or Issues related to SQL Formatting
Projects
None yet
Development

No branches or pull requests

1 participant