Skip to content

Formatter inconsistencies #128

@bigfoot90

Description

@bigfoot90

I'm rewriting Formatter's tests, and during my PR #120 I've noticed some inconsistencies and I would discuss them with you.

1 Create procedure (Done in #152)
https://github.com/bigfoot90/sql-parser/blob/d957633d2259f293b77affb3f8e223f4ed7cf7f2/tests/Utils/FormatterTest.php#L352-L357

CREATE
PROCEDURE test_procedure() BEGIN
FROM
    tbl
SELECT
    *; END
  • CREATE PROCEDURE should be on the same line (like SELECT DISTINCT already does)
  • BEGIN and END should go to a new line

2 Insert into (Done this too)
https://github.com/bigfoot90/sql-parser/blob/d957633d2259f293b77affb3f8e223f4ed7cf7f2/tests/Utils/FormatterTest.php#L376-L379

INSERT
INTO
    foo
VALUES(0, 0, 0),(1, 1, 1)
  • INSERT INTO should be on the same line (like SELECT DISTINCT)
  • Put a blank space after VALUES keyword?
  • The values (0, 0, 0) and (1, 1, 1) should go to their own rows (like the other query parts does) if the option parts_newline is true (the default).

I haven't ended with #120 yet, I will add here more questions about formatting as soon I will find them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions