Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^3: search data structures using SQL

by einhverfr (Friar)
on Nov 17, 2013 at 05:05 UTC ( #1062970=note: print w/replies, xml ) Need Help??

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 (Canon) on Nov 18, 2013 at 02:03 UTC

    Good point; but it's not the interface I care about. I'm not insisting that it be SQL. What I'm looking for is a replacement for the bletcherous blob of an engine I wrote. I assume (yeah, I know) that an engine that implements an SQL interface will be able to do what I want. If I can get the engine without the SQL, that's fine too.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1062970]
robby_dobby is not entirely serious
[LanX]: ... thank God France doesn't have an electoral college...
[Eily]: LanX, let's hope it gets better for the second turn
vrk adds oatmeal cookies to the platter on the sideboard.
[LanX]: evrybody can participate in a YAPC
choroba is still undecided what to present at YAPC
[LanX]: imagine the stock market if the choice for the second round would have been those two ...
[robby_dobby]: LanX: Not me. No YAPC in my country and the only one in Asia is so far off in Japan
[LanX]: Oh I thought "Misery" meant Missoury
[LanX]: where do you live?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2017-04-24 15:55 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (442 votes). Check out past polls.