File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ A validating SQL lexer and parser with a focus on MySQL dialect.
1616
1717Please use [ Composer] [ 1 ] to install:
1818
19- ```
19+ ``` sh
2020composer require phpmyadmin/sql-parser
2121```
2222
@@ -53,6 +53,7 @@ All commands are able to parse input from stdin (standard in), such as:
5353echo " SELECT 1" | ./vendor/bin/highlight-query
5454cat example.sql | ./vendor/bin/lint-query
5555```
56+
5657### Formatting SQL query
5758
5859``` php
@@ -77,7 +78,7 @@ echo $flags['querytype'];
7778``` php
7879require __DIR__ . '/vendor/autoload.php';
7980
80- $query1 = " select * from a" ;
81+ $query1 = ' select * from a' ;
8182$parser = new PhpMyAdmin\SqlParser\Parser($query1);
8283
8384// inspect query
@@ -103,18 +104,21 @@ var_dump($query2); // outputs string(19) 'SELECT * FROM "b" '
103104## Localization
104105
105106You can localize error messages installing ` phpmyadmin/motranslator ` version ` 5.0 ` or newer:
107+
106108``` sh
107109composer require phpmyadmin/motranslator:^5.0
108110```
109111
110112The locale is automatically detected from your environment, you can also set a different locale
111113
112114** From cli** :
115+
113116``` sh
114117LC_ALL=pl ./vendor/bin/lint-query --query " SELECT 1"
115118```
116119
117120** From php** :
121+
118122``` php
119123require __DIR__ . '/vendor/autoload.php';
120124
You can’t perform that action at this time.
0 commit comments