> parse / stringify sql (select grammar) in js.
npm install @kromtech/js-sql-parser> parse / stringify sql (select grammar) in js.
[![Build Status][travis-image]][travis-url]
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
sql grammar follows https://dev.mysql.com/doc/refman/5.7/en/select.html
npm install --save js-sql-parser
``js
const parser = require('js-sql-parser');
const ast = parser.parse('select * from dual');
console.log(JSON.stringify(ast, null, 2));
ast.value.selectItems.value[0].value = 'foo';
ast.value.from.value[0].value.value.value = 'bar';
console.log(parser.stringify(ast));
// SELECT foo FROM bar
`
`js