Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LincWorld/js-sql-parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-sql-parser

parse / stringify sql like grammer in js.

NPM

commonjs usage

npm install --save @lincworld/js-sql-parser

const parser = require('js-sql-parser');
const ast = parser.parse('get * from dual');

console.log(JSON.stringify(ast, null, 2));

ast.value.getItems.value[0].value = 'foo';
ast.value.from.value[0].value.value.value = 'bar';

console.log(parser.stringify(ast));
// GET foo FROM bar

script tag

<script src="./dist/parser/sqlParser.js"><script/>

var sqlParser = window.sqlParser;
var ast = sqlParser.parse('get * from dual');
var sql = sqlParser.stringify(ast);

Build

  • Run npm run build to build the distributable.

LICENSE

MIT

About

For Internal Use

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 54.3%
  • Yacc 45.7%