0

I am using node+ejs for rendering the pages. In one page I want to validate the SQL query syntax which is been entered. By searching I got to know sql-parser is the way to do that but I don't know how to do.

Now my question is, how to use sql-parser to validate the query in nodejs.

since I am a beginner to this I don't have any idea. hopefully someone can guide me in the right direction.Thanks in Advance.

Ask me for more clarification.

Wolverine
  • 17
  • 7
  • Can you provide a link to sql-parse within the NPM site? There are a few packages that have `sql-parser` in it so I'm not sure which one you mean. Second, post some code if you have it showing what you've tried. Third, a lot of these libraries have documentation on how to use them with code samples. What exactly aren't you understanding about the library? – Michael Platt Apr 10 '19 at 13:12
  • @MichaelPlatt, sorry sir for the late reply.Since I am new to this I don't know about the libraries. while searching I got to know sql-parser is the way. I referred from this link http://jsfiddle.net/Hb6az/ – Wolverine Apr 11 '19 at 04:56
  • this is the functionality --> http://www.dpriver.com/blog/list-of-demos-illustrate-how-to-use-general-sql-parser/vendor-specific-offline-sql-syntax-check/ – Wolverine Apr 11 '19 at 05:27
  • So I can't get that JSFiddle working with that specific library you mentioned but if you are using Nodejs, I found a pretty good looking library here that might do the same thing for you: https://www.npmjs.com/package/node-sqlparser It seems pretty lightweight and should still do what you want and tells you how to import it into your project. Hopefully that helps. – Michael Platt Apr 11 '19 at 12:15
  • Thank you sir, I will look into this in detail :) – Wolverine Apr 12 '19 at 05:13

0 Answers0