From e5a8da3a2edd7c7d453ba212fdff1b386b2faf76 Mon Sep 17 00:00:00 2001 From: Erik Thiart Date: Tue, 29 Jun 2021 14:42:08 +0200 Subject: [PATCH] Fixed the output --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a144323..3287639 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,31 @@ echo SqlFormatter::format($query); Output: -![](http://jdorn.github.com/sql-formatter/format-highlight.png) +```sql + +SELECT + count(*), + `Column1`, + `Testing`, + `Testing Three` +FROM + `Table1` +WHERE + Column1 = 'testing' + AND ( + ( + `Column2` = `Column3` + OR Column4 >= NOW() + ) + ) +GROUP BY + Column1 +ORDER BY + Column3 DESC +LIMIT + 5, 10 + +``` Formatting Only ------------------------- @@ -55,7 +79,10 @@ echo SqlFormatter::format($query, false); Output: -![](http://jdorn.github.com/sql-formatter/format.png) +``` +SELECT count(*), `Column1`, `Testing`, `Testing Three` FROM `Table1` WHERE Column1 = 'testing' AND ( ( `Column2` = `Column3` OR Column4 >= NOW() ) ) GROUP BY Column1 ORDER BY Column3 DESC LIMIT 5, 10 + +``` Syntax Highlighting Only ------------------------- @@ -73,7 +100,13 @@ echo SqlFormatter::highlight($query); Output: -![](http://jdorn.github.com/sql-formatter/highlight.png) +```sql + +SELECT count(*),`Column1`,`Testing`, `Testing Three` FROM `Table1` + WHERE Column1 = 'testing' AND ( (`Column2` = `Column3` OR Column4 >= NOW()) ) + GROUP BY Column1 ORDER BY Column3 DESC LIMIT 5,10 + +``` Compress Query -------------------------- @@ -97,8 +130,10 @@ echo SqlFormatter::compress($query) Output: -``` +```sql + SELECT Id as temp, DateCreated as Created FROM MyTable; + ``` Remove Comments @@ -121,7 +156,7 @@ echo SqlFormatter::removeComments($query); ``` Output: -``` +```sql SELECT