summaryrefslogtreecommitdiffstats
path: root/examples/examples.php
diff options
context:
space:
mode:
authorJeremy Dorn <jeremy@jeremydorn.com>2013-06-12 20:56:09 -0700
committerJeremy Dorn <jeremy@jeremydorn.com>2013-06-12 20:56:09 -0700
commit3c7983d6d638233ea8e0e7705a3a8f3e4921ca75 (patch)
treeeb22ed4f7f26107be94eedcbeedcce16162b89ae /examples/examples.php
parentbd1f09133f6dbbe0713856910e58ea9480c2be58 (diff)
downloadsql-formatter-3c7983d6d638233ea8e0e7705a3a8f3e4921ca75.zip
sql-formatter-3c7983d6d638233ea8e0e7705a3a8f3e4921ca75.tar.gz
sql-formatter-3c7983d6d638233ea8e0e7705a3a8f3e4921ca75.tar.bz2
Added new compress method. Fixes #41
Added test cases for CLI mode and compress method. Bumped patch version.
Diffstat (limited to 'examples/examples.php')
-rw-r--r--examples/examples.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/examples.php b/examples/examples.php
index 0d3c641..9d69182 100644
--- a/examples/examples.php
+++ b/examples/examples.php
@@ -183,6 +183,30 @@ $comment_statements = array(
</table>
+<h1>Compress Query</h1>
+
+<div>
+ Usage:
+ <pre>
+ <?php highlight_string('<?php' . "\n" . '$compressed = SqlFormatter::compress($sql);' . "\n" . '?>'); ?>
+ </pre>
+</div>
+<table>
+ <tr>
+ <th>Original</th>
+ <th>Compressed</th>
+ </tr>
+ <?php foreach ($statements as $sql) { ?>
+ <tr>
+ <td>
+ <pre><?php echo $sql; ?></pre>
+ </td>
+ <td><pre><?php echo SqlFormatter::compress($sql); ?></pre></td>
+ </tr>
+ <?php } ?>
+</table>
+
+
<h1>Splitting SQL Strings Into Individual Queries</h1>
<div>