Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

First, this is rather vague. I don't know how complex SQL you have to support and you have to figure that as soon as you implement one feature someone else will say they can't live without another feature.

What you are essentially talking about is implementing an in-memory db in Perl. this is not likely to remain "easy" or "only using modules in the standard library" for long and it is critically important that you inform $management of these problems before you get started. Let them figure out what they *really* want from this. Otherwise you will end up trapped in a hole that will just keep getting deeper and $management will decide that the way out is to tunnel to $antipode.

Now this being said, the next thing is to say that if you are going to support it, you are only going to support very simple searches in the form of SELECT column_list FROM table_name WHERE condition. From there simple parsers should be possible using regexps. Note that this is a *tiny* subset of SQL and if they want anything else, or to be able to have a column named "from" (not an unreasonable request) you are going to need something like Parse::RecDescent and restart this from scratch. Basically at that point, you get into hierarchy of language problems.

However, my advice is that before you do this, stop, and have the difficult discussion with your boss. Inform him of what the real problems are, and that this will involve reinventing lots of stuff from CPAN if it goes beyond basic parsing with a total prohibition on use of reserved words as names. $management gets paid to make the decisions. Let them make it. But make sure that they know what they are getting into....


In reply to Re: search data structures using SQL by einhverfr
in thread search data structures using SQL by jdporter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-26 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found