Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: search data structures using SQL (upd: FP, LINQ, int vs ext DSL)

by LanX (Saint)
on Nov 16, 2013 at 02:51 UTC ( [id://1062843]=note: print w/replies, xml ) Need Help??


in reply to search data structures using SQL

> I would like to be able to do some basic searching of this data using SQL.

Well how basic is basic ?

Showing some of the features you expect might help.

I think it shouldn't be too difficult to use functional programming to define and combine map like functions like

 select {} from {} where {}

Not exactly SQL, but I'm not sure which complexity and performance you exactly expect without installing complicated CPAN-modules.

But I would be surprised if nobody did this already before...

Cheers Rolf

( addicted to the Perl Programming Language)

update

this older discussion about LINQ may be of interest: LINQ/Ambition for Perl?

IMHO you should at least clarify how you want the "basic SQL" DSL to be realized: internally or externally?

Replies are listed 'Best First'.
Re^2: search data structures using SQL (upd: FP, LINQ, int vs ext DSL)
by jdporter (Paladin) on Nov 16, 2013 at 15:36 UTC

    Cool. Thanks. By "basic", I mean SELECTs of not more than moderate complexity. No inserts/updates/deletes. What I'm imagining is that what I want can be done by any SQL engine available in Perl.

    The data I have is definitely relationally structured; it's well normalized, and there are relation tables for many-to-many relationships.

    So if I could do relational calculus using something other than SQL, that would be fine; but remember that I'm limited to whatever is available in a standard perl installation. ActiveState, I believe, though I'm not sure which version. Probably 5.12 or so.

      Still don't know if you want an external or internal DSL.

      External means you need an interpreter (parser + compiler) for a string holding SQL.

      Internal means chaining/cascading Perl functions/methods with "SQL-like" names and semantics in combination with Perl builtins like shown before.

      I prefer the latter.

      > I mean SELECTs of not more than moderate complexity.

      Please gimme some explicit examples of those SQLs of "moderate complexity" and I'll be pleased to show an internal DSL approach built on FP.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1062843]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-03-28 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found