All Projects → JavaScriptor → Js Sql Parser

JavaScriptor / Js Sql Parser

Licence: mit
SQL(select) parser written with jison. parse SQL into abstract syntax tree(AST) and stringify back to SQL. sql grammar follows https://dev.mysql.com/doc/refman/5.7/en/select.html

Programming Languages

javascript
184084 projects - #8 most used programming language
js
455 projects

Projects that are alternatives of or similar to Js Sql Parser

Rewrite
Semantic code search and transformation
Stars: ✭ 134 (-4.96%)
Mutual labels:  ast, abstract-syntax-tree
tsquery-playground
Playground for TSQuery
Stars: ✭ 30 (-78.72%)
Mutual labels:  ast, abstract-syntax-tree
vscode-blockman
VSCode extension to highlight nested code blocks
Stars: ✭ 233 (+65.25%)
Mutual labels:  ast, abstract-syntax-tree
codeparser
Parse Wolfram Language source code as abstract syntax trees (ASTs) or concrete syntax trees (CSTs)
Stars: ✭ 84 (-40.43%)
Mutual labels:  ast, abstract-syntax-tree
I18nize React
Internationalize react apps within a lunch break
Stars: ✭ 389 (+175.89%)
Mutual labels:  ast, abstract-syntax-tree
abstract-syntax-tree
A library for working with abstract syntax trees.
Stars: ✭ 77 (-45.39%)
Mutual labels:  ast, abstract-syntax-tree
verilogAST-cpp
C++17 implementation of an AST for Verilog code generation
Stars: ✭ 14 (-90.07%)
Mutual labels:  ast, abstract-syntax-tree
Bellybutton
Custom Python linting through AST expressions
Stars: ✭ 196 (+39.01%)
Mutual labels:  ast, abstract-syntax-tree
Javaparser
Java 1-15 Parser and Abstract Syntax Tree for Java, including preview features to Java 13
Stars: ✭ 3,972 (+2717.02%)
Mutual labels:  ast, abstract-syntax-tree
Jsqlparser
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Stars: ✭ 3,405 (+2314.89%)
Mutual labels:  ast, mysql
open-fortran-parser-xml
XML output generator for Open Fortran Parser, and Python wrapper for it.
Stars: ✭ 21 (-85.11%)
Mutual labels:  ast, abstract-syntax-tree
Deps Report
Generate reports about dependencies and dependents of your JavaScript/TypeScript files through an AST. It supports import and require statements.
Stars: ✭ 76 (-46.1%)
Mutual labels:  ast, abstract-syntax-tree
awesome-ruby-ast
A list of awesome tools and libraries which deals with ASTs in Ruby
Stars: ✭ 24 (-82.98%)
Mutual labels:  ast, abstract-syntax-tree
CastXMLSuperbuild
Build CastXML and its dependencies (LLVM/Clang)
Stars: ✭ 32 (-77.3%)
Mutual labels:  ast, abstract-syntax-tree
Vermin
Concurrently detect the minimum Python versions needed to run code
Stars: ✭ 218 (+54.61%)
Mutual labels:  ast, abstract-syntax-tree
coAST
Universal and language-independent abstract syntax tree
Stars: ✭ 30 (-78.72%)
Mutual labels:  ast, abstract-syntax-tree
React Ast
render abstract syntax trees with react
Stars: ✭ 160 (+13.48%)
Mutual labels:  ast, abstract-syntax-tree
ast-builder
Build your ASTs directly from code
Stars: ✭ 18 (-87.23%)
Mutual labels:  ast, abstract-syntax-tree
Spoon
Spoon is a metaprogramming library to analyze and transform Java source code (up to Java 15). 🥄 is made with ❤️, 🍻 and ✨. It parses source files to build a well-designed AST with powerful analysis and transformation API.
Stars: ✭ 1,078 (+664.54%)
Mutual labels:  ast, abstract-syntax-tree
Cgen
C/C++ source generation from an AST
Stars: ✭ 107 (-24.11%)
Mutual labels:  ast, abstract-syntax-tree

js-sql-parser

parse / stringify sql (select grammar) in js.

Build Status NPM Version NPM Downloads

sql grammar follows https://dev.mysql.com/doc/refman/5.7/en/select.html

news

  • Fix bug using ' & " for column alias? since v1.4.1 #40, #44
  • Fix bug tableFactor alias since v1.3.0 #34
  • Add support for "`" quoted alias since v1.2.2. #33
  • Fix bug stringify keyword having since v1.2.1. #29
  • Typo 'refrence' has been fixed to 'reference' since v1.2.0.

for more changes see CHANGELOG

commonjs usage

npm install --save js-sql-parser

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

script tag

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

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

AMD supported

...

unsupported grammar currently

  • Hexadecimal Literals as x'01af' X'01af', but 0x01af is supported.
  • keyword COLLATE.
  • parammarker: keyword PREPARE / EXECUTE / DEALLOCATE
  • variable: keyword SET / CREATE PROCEDURE / CREATE FUNCTION
  • identifier expr: ODBC escape syntax
  • matchexpr: Full-Text Search Functions. // to support
  • intervalexpr: Date INTERVAL keyword. // to support
  • into outfile: INTO OUTFILE keyword. // to support

TODO

  • ${value} like value place holder support.

Build

  • Run npm run build to build the distributable.

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].