in reply to Re^2: search data structures using SQL
in thread search data structures using SQL
If you are going to do that, why not just skip SQL, take what is good from SQL, and apply Perlisms to it?
I.e. instead of SELECT foo FROM bar WHERE baz is not true; why not come up with an SQL-inspired interface that avoids the parsing issues, something like:
select( columns => ['foo'], start_table => 'bar', condition => '? or !defined ?', bind => ['baz', 'baz'] );
This would avoid the parsing problems, allow you to add joins, cte's, inline views, and more if you ever need it. It would avoid the hard problems while giving you something where you and your successor could leverage sql knowledge. That means essentially passing in the parse tree rather than the declarative statement to the function, and as such it also avoids the possibility of sql injection.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: search data structures using SQL
by jdporter (Paladin) on Nov 18, 2013 at 02:03 UTC |