dsferruzza / simpleSqlParser

Javascript library to parse CRUD (Create Retrieve Update Delete) SQL queries.
98 stars 30 forks source link

Adds LIKE and IN operators support to readWord #11

Closed joshuafcole closed 10 years ago

joshuafcole commented 10 years ago

Apologies for the whitespace edits, I'd normally do those as a separate commit if at all, but my editor at work is rather cleanup happy. :)

Cheers!

dsferruzza commented 10 years ago

It seems nice! Thanks!

Could you please make 2 changes before I merge?

joshuafcole commented 10 years ago

Ah, sorry about tabs vs. spaces. I'm using Light Table and it seems a little more opinionated than I am on the subject. I'll go ahead and do both shortly.

dsferruzza commented 10 years ago

Cool!

joshuafcole commented 10 years ago

Two basic unit tests added. I tried to maintain the style of the existing work. I can add a couple more if you like.

Of note, my implementation of IN leaves something to be desired -- it works fine, but I wish I'd been able to transform the right value of IN conditions into an array. Unfortunately, the tokenizer doesn't have any look-behind support to see that the previous operator was an IN, and while I could have gotten around that with some hackiness it didn't seem worthwhile. Would be good to do on V2 if you aren't already. I'm going to move forward using V1 at work for now, but as spare time permits I'll start playing with V2 and report back on any issues I run into.

Thanks again for your hard work!

dsferruzza commented 10 years ago

Thanks! Your tests seems nice! I'll release a new version soon.

I haven't started to work on the v2 condition parsing at all, so the behavior you mention is not implemented yet. I hope I'll be able to do it soon :)

Thanks for you support!

dsferruzza commented 10 years ago

Can I add you to the contributor section of the package.json file? Shall I take info from here https://github.com/joshuafcole?

joshuafcole commented 10 years ago

Sure! You're welcome to do so if you wish, though it was really a small contribution. I hope to be of more service in the future on V2. :)