sql-formatter
sql-formatter copied to clipboard
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.
See https://github.com/jdorn/sql-formatter/issues/59
See https://github.com/jdorn/sql-formatter/issues/83
See https://github.com/jdorn/sql-formatter/issues/89#issuecomment-235527929 and also https://github.com/jdorn/sql-formatter/issues/87
Match next token using single regex only, +18% speedup. In the future, `Tokenizer::makeTokenizeRegexes()` method can be made public to allow grammar override for each token type.
submitting as a separate PR as requested
As analysed in https://github.com/doctrine/sql-formatter/pull/116#issuecomment-2125860461. A little related with #39 formatting. https://github.com/doctrine/sql-formatter/blob/1.4.0/src/Highlighter.php#L38-L46 should be removed then as we are very, very far validating queries (and it is impossible to do it...