[Bast-commits] r9664 - in SQL-Abstract/1.x/branches/sqla-tree:
lib/SQL/Abstract t
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Tue Aug 31 04:13:05 GMT 2010
Author: frew
Date: 2010-08-31 05:13:04 +0100 (Tue, 31 Aug 2010)
New Revision: 9664
Added:
SQL-Abstract/1.x/branches/sqla-tree/t/11unparse.t
Modified:
SQL-Abstract/1.x/branches/sqla-tree/lib/SQL/Abstract/Tree.pm
Log:
document hopes and dreams
Modified: SQL-Abstract/1.x/branches/sqla-tree/lib/SQL/Abstract/Tree.pm
===================================================================
--- SQL-Abstract/1.x/branches/sqla-tree/lib/SQL/Abstract/Tree.pm 2010-08-31 03:55:05 UTC (rev 9663)
+++ SQL-Abstract/1.x/branches/sqla-tree/lib/SQL/Abstract/Tree.pm 2010-08-31 04:13:04 UTC (rev 9664)
@@ -182,7 +182,7 @@
return join (" $tree->[0] ", map {unparse($_)} @{$tree->[1]});
}
else {
- return sprintf '%s %s', $tree->[0], unparse ($tree->[1]);
+ return sprintf "%s %s\n", $tree->[0], unparse ($tree->[1]);
}
}
Added: SQL-Abstract/1.x/branches/sqla-tree/t/11unparse.t
===================================================================
--- SQL-Abstract/1.x/branches/sqla-tree/t/11unparse.t (rev 0)
+++ SQL-Abstract/1.x/branches/sqla-tree/t/11unparse.t 2010-08-31 04:13:04 UTC (rev 9664)
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+
+use SQL::Abstract::Tree;
+
+{
+ my $sql = "SELECT a, b, c
+ FROM foo WHERE foo.a =1 and foo.b LIKE 'station'";
+
+ print "$sql\n";
+ print SQL::Abstract::Tree::unparse(SQL::Abstract::Tree::parse($sql)) . "\n";
+}
+
+{
+ my $sql = "SELECT *
+ FROM (SELECT * FROM foobar) WHERE foo.a =1 and foo.b LIKE 'station'";
+
+ print "$sql\n";
+ print SQL::Abstract::Tree::unparse(SQL::Abstract::Tree::parse($sql)) . "\n";
+}
+
+# stuff we want:
+# Nested indentation
+# Max Width
+# Color coding (console)
+# Color coding (html)
More information about the Bast-commits
mailing list