projects
/
dbsrgits/Data-Query.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
d131041
)
DELETE support
Matt S Trout [Sun, 31 Jul 2011 10:01:32 +0000 (10:01 +0000)]
lib/Data/Query/Constants.pm
patch
|
blob
|
blame
|
history
lib/Data/Query/Renderer/SQL/Naive.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Data/Query/Constants.pm
b/lib/Data/Query/Constants.pm
index
2b8a7fc
..
0850fbb
100644
(file)
--- a/
lib/Data/Query/Constants.pm
+++ b/
lib/Data/Query/Constants.pm
@@
-14,6
+14,7
@@
use constant +{
DQ_JOIN => 'Join',
DQ_ORDER => 'Order',
DQ_WHERE => 'Where',
+ DQ_DELETE => 'Delete',
))
};
diff --git
a/lib/Data/Query/Renderer/SQL/Naive.pm
b/lib/Data/Query/Renderer/SQL/Naive.pm
index
1049b46
..
6c2375a
100644
(file)
--- a/
lib/Data/Query/Renderer/SQL/Naive.pm
+++ b/
lib/Data/Query/Renderer/SQL/Naive.pm
@@
-356,4
+356,9
@@
sub _render_order {
\@ret;
}
+sub _render_delete {
+ my ($self, $dq) = @_;
+ [ $self->_format_keyword('DELETE FROM'), @{$self->_render($dq->{from})} ];
+}
+
1;