Skip to content

Commit f06862f

Browse files
committed
Add example for changing SQL mode
Fixes #124 Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 2a589a3 commit f06862f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ $parser->statements[0]->from[0] = $table2;
7777
$statement = $parser->statements[0];
7878
$query2 = $statement->build();
7979
var_dump($query2); // outputs string(19) "SELECT * FROM `b` "
80+
81+
// Change SQL mode
82+
SqlParser\Context::setMode('ANSI_QUOTES');
83+
84+
// build the query again using different quotes
85+
$query2 = $statement->build();
86+
var_dump($query2); // outputs string(19) "SELECT * FROM "b" "
8087
```
8188

8289
## More information

0 commit comments

Comments
 (0)