All Projects → godmodelabs → Flora Sql Parser

godmodelabs / Flora Sql Parser

Licence: gpl-2.0
Parse SQL (select) statements into abstract syntax tree (AST) and convert ASTs back to SQL.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Flora Sql Parser

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 (+1730.65%)
Mutual labels:  ast, sql, parser
Graphql Go Tools
Tools to write high performance GraphQL applications using Go/Golang.
Stars: ✭ 96 (-48.39%)
Mutual labels:  ast, parser
Gorm2sql
auto generate sql from gorm model struct
Stars: ✭ 92 (-50.54%)
Mutual labels:  ast, sql
Babylon
PSA: moved into babel/babel as @babel/parser -->
Stars: ✭ 1,692 (+809.68%)
Mutual labels:  ast, parser
I Pascal
A free Object Pascal language plugin for IntelliJ IDEA
Stars: ✭ 85 (-54.3%)
Mutual labels:  ast, parser
Diffsitter
A tree-sitter based AST difftool to get meaningful semantic diffs
Stars: ✭ 89 (-52.15%)
Mutual labels:  ast, parser
Phplrt
PHP Language Recognition Tool
Stars: ✭ 127 (-31.72%)
Mutual labels:  ast, parser
Astexplorer.app
https://astexplorer.net with ES Modules support and Hot Reloading
Stars: ✭ 65 (-65.05%)
Mutual labels:  ast, parser
Json To Ast
JSON AST parser
Stars: ✭ 161 (-13.44%)
Mutual labels:  ast, parser
Query Translator
Query Translator is a search query translator with AST representation
Stars: ✭ 165 (-11.29%)
Mutual labels:  ast, parser
Gitbase
SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase
Stars: ✭ 1,955 (+951.08%)
Mutual labels:  ast, sql
Lang C
Lightweight C parser for Rust
Stars: ✭ 77 (-58.6%)
Mutual labels:  ast, parser
Method log
Trace the history of an individual method in a git repository (experimental)
Stars: ✭ 73 (-60.75%)
Mutual labels:  ast, parser
Libdparse
Library for lexing and parsing D source code
Stars: ✭ 91 (-51.08%)
Mutual labels:  ast, parser
Charly Vm
Fibers, Closures, C-Module System | NaN-boxing, bytecode-VM written in C++
Stars: ✭ 66 (-64.52%)
Mutual labels:  ast, parser
Elm Markdown
Pure Elm markdown parsing and rendering
Stars: ✭ 96 (-48.39%)
Mutual labels:  ast, parser
Ts Sql
A SQL database implemented purely in TypeScript type annotations.
Stars: ✭ 2,324 (+1149.46%)
Mutual labels:  sql, parser
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 (+479.57%)
Mutual labels:  ast, parser
Csstree
A tool set for CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations
Stars: ✭ 1,121 (+502.69%)
Mutual labels:  ast, parser
Lioness
The Lioness Programming Language
Stars: ✭ 155 (-16.67%)
Mutual labels:  ast, parser

Flora SQL Parser

NPM version NPM downloads

Parse simple SQL statements into an abstract syntax tree (AST) and convert it back to SQL.

Usage

Create AST for SQL statement

const { Parser } = require('flora-sql-parser');
const parser = new Parser();
const ast = parser.parse('SELECT * FROM t');

console.log(ast);

Convert AST back to SQL

const { Parser } = require('flora-sql-parser');
const ast = (new Parser()).parse('SELECT * FROM t');
const toSQL = require('flora-sql-parser').util.astToSQL;

console.log(toSQL(ast));

The generated SQL is ANSI SQL compliant. To run those queries on MySQL, make sure you set correct SQL mode

SET SESSION sql_mode = 'ANSI';

before running any query.

Acknowledgement

This project is based on the SQL parser extracted from Alibaba's nquery module.

License

GPL-2.0

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].