[Bast-commits] r9778 - in SQL-Abstract/1.x/trunk: . examples
lib/SQL/Abstract
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Sat Oct 23 02:18:52 GMT 2010
Author: frew
Date: 2010-10-23 02:18:52 +0000 (Sat, 23 Oct 2010)
New Revision: 9778
Modified:
SQL-Abstract/1.x/trunk/Changes
SQL-Abstract/1.x/trunk/examples/console.pl
SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
Log:
fix pagination keywords
Modified: SQL-Abstract/1.x/trunk/Changes
===================================================================
--- SQL-Abstract/1.x/trunk/Changes 2010-10-23 01:49:36 UTC (rev 9777)
+++ SQL-Abstract/1.x/trunk/Changes 2010-10-23 02:18:52 UTC (rev 9778)
@@ -2,6 +2,9 @@
revision 1.69 2010-10-22
----------------------------
+ - Add quotes for populated placeholders and make the background
+ magenta instead of cyan
+ - Color and indent pagination keywords
- Fix a silly bug which broke placeholder fill-in in DBIC
- Installs format-sql to format SQL passed in over STDIN
- Switch the tokenizer to precompiled regexes (massive speedup)
Modified: SQL-Abstract/1.x/trunk/examples/console.pl
===================================================================
--- SQL-Abstract/1.x/trunk/examples/console.pl 2010-10-23 01:49:36 UTC (rev 9777)
+++ SQL-Abstract/1.x/trunk/examples/console.pl 2010-10-23 02:18:52 UTC (rev 9778)
@@ -8,6 +8,10 @@
"SELECT a, b, c FROM foo WHERE foo.a =1 and foo.b LIKE 'station'",
"SELECT * FROM (SELECT * FROM foobar) WHERE foo.a =1 and foo.b LIKE 'station'",
"SELECT * FROM lolz WHERE ( foo.a =1 ) and foo.b LIKE 'station'",
+ "SELECT * LIMIT 5 OFFSET 5 FROM lolz ",
+ "SELECT * LIMIT 5 5 FROM lolz ",
+ "SELECT SKIP 5 FIRST 5 * FROM lolz ",
+ "SELECT FIRST 5 SKIP 5 * FROM lolz ",
"UPDATE session SET expires = ? WHERE (id = ?)",
"INSERT INTO Request (creation_date, is_private, owner_id, request) VALUES (? , ? , ? , ?)",
"SELECT [screen].[id], [screen].[name], [screen].[section_id], [screen].[xtype] FROM [users_roles] [me] JOIN [roles] [role] ON [role].[id] = [me].[role_id] JOIN [roles_permissions] [role_permissions] ON [role_permissions].[role_id] = [role].[id] JOIN [permissions] [permission] ON [permission].[id] = [role_permissions].[permission_id] JOIN [permissionscreens] [permission_screens] ON [permission_screens].[permission_id] = [permission].[id] JOIN [screens] [screen] ON [screen].[id] = [permission_screens].[screen_id] WHERE ( [me].[user_id] = ? ) GROUP BY [screen].[id], [screen].[name], [screen].[section_id], [screen].[xtype]",
Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm 2010-10-23 01:49:36 UTC (rev 9777)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract/Tree.pm 2010-10-23 02:18:52 UTC (rev 9778)
@@ -68,6 +68,8 @@
'GROUP \s+ BY',
'HAVING',
'ORDER \s+ BY',
+ 'SKIP',
+ 'FIRST',
'LIMIT',
'OFFSET',
'FOR',
@@ -151,6 +153,10 @@
set => 1,
into => 1,
values => 1,
+ limit => 1,
+ offset => 1,
+ skip => 1,
+ first => 1,
);
my %profiles = (
@@ -186,6 +192,11 @@
'group by' => [$c->('yellow'), $c->('reset')],
'order by' => [$c->('yellow'), $c->('reset')],
+
+ skip => [$c->('green'), $c->('reset')],
+ first => [$c->('green'), $c->('reset')],
+ limit => [$c->('green'), $c->('reset')],
+ offset => [$c->('green'), $c->('reset')],
}
);
} : (),
@@ -210,15 +221,24 @@
'insert into' => ['<span class="insert-into">' , '</span>'],
update => ['<span class="select">' , '</span>'],
'delete from' => ['<span class="delete-from">' , '</span>'],
+
+ set => ['<span class="set">', '</span>'],
+ from => ['<span class="from">' , '</span>'],
+
where => ['<span class="where">' , '</span>'],
- from => ['<span class="from">' , '</span>'],
+ values => ['<span class="values">', '</span>'],
+
join => ['<span class="join">' , '</span>'],
+ 'left join' => ['<span class="left-join">','</span>'],
on => ['<span class="on">' , '</span>'],
+
'group by' => ['<span class="group-by">', '</span>'],
'order by' => ['<span class="order-by">', '</span>'],
- set => ['<span class="set">', '</span>'],
- into => ['<span class="into">', '</span>'],
- values => ['<span class="values">', '</span>'],
+
+ skip => ['<span class="skip">', '</span>'],
+ first => ['<span class="first">', '</span>'],
+ limit => ['<span class="limit">', '</span>'],
+ offset => ['<span class="offset">', '</span>'],
},
indentmap => { %indents },
},
More information about the Bast-commits
mailing list