Skip Menu |

This queue is for tickets about the Filter-SQL CPAN distribution.

Report information
The Basics
Id: 52480
Status: new
Priority: 0/
Queue: Filter-SQL

People
Owner: Nobody in particular
Requestors: bananafishmonger [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.10
Fixed in: (no value)



Subject: When parenthis were omitted, the method this package don't had was called.
When I wrote like "print Dumper SELECT * FROM foo;;", died and received message "Can't locate object method "Dumper" via package "Filter::SQL" ". But, when I wrote like "print Dumper(SELECT * FROM foo;);", it's is all succeed. Would you make this adopted as valid grammar if you want to do ? 初めまして、いつも楽しくブログを拝見させていただいております。 SQLを直感的に書けるとても画期的なモジュールでしたので、色々と遊ばせてい ただいていましたところ、 関数の引数として与えた場合において、括弧を省略した場合に、通常通りの動作 になりませんでした(関数が Filter::SQL のメソッドとして呼ばれてしまいまし た)。 おそらく print Dumper SELECT * FROM hoge;; とした場合には print Dumper Filter::SQL->sql_selectall(undef, 'SELECT * FROM hoge'); と置換され、new Hoge()->anyMethod() と同じものとして解釈さているように思 われます。 もしよろしければ print Dumper SELECT ~ と書けるようにすることも視野に入 れていただけたらと存じます。 なにか至らない点がありましたら、この場を借りてお詫び申し上げます。
Subject: omit_parenthesis.t
use Test::More; use Filter::SQL; use Data::Dumper; BEGIN { if (! defined $ENV{FILTER_SQL_DBI} || $ENV{FILTER_SQL_DBI} !~ /^dbi:mysql:/) { plan skip_all => 'Skipping MySQL specific tests'; } else { plan tests => 4; } }; ok(EXEC CREATE TEMPORARY TABLE omit_paranthesis_t (str VARCHAR (255));); ok(INSERT INTO omit_paranthesis_t VALUES('test');); ok(Dumper(SELECT * FROM omit_paranthesis_t;)); ok(Dumper SELECT * FROM omit_paranthesis_t; ); # I want to write like this! __END__ =pod This is the result of command `perl -MO=Deparse omit_parenthesis.t`. sub BEGIN { require 5.01; } use Test::More; use Filter::SQL; use Data::Dumper; sub BEGIN { BEGIN { $^H{'feature_say'} = q(1); $^H{'feature_state'} = q(1); $^H{'feature_switch'} = q(1); } if (not defined $ENV{'FILTER_SQL_DBI'} or not $ENV{'FILTER_SQL_DBI'} =~ /^dbi:mysql:/) { plan('skip_all', 'Skipping MySQL specific tests'); } else { plan('tests', 4); } } BEGIN { $^H{'feature_say'} = q(1); $^H{'feature_state'} = q(1); $^H{'feature_switch'} = q(1); } ok 'Filter::SQL'->sql_prepare_exec('CREATE TEMPORARY TABLE omit_paranthesis_t (str VARCHAR (255))'); ok 'Filter::SQL'->sql_prepare_exec('INSERT INTO omit_paranthesis_t VALUES(?)', 'test'); ok Dumper('Filter::SQL'->sql_selectall(undef, 'SELECT * FROM omit_paranthesis_t')); ok 'Filter::SQL'->Dumper->sql_selectall(undef, 'SELECT * FROM omit_paranthesis_t'); omit_parenthesis.t syntax OK =cut