Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alsotang/sql.pegjs


https://github.com/alsotang/sql.pegjs

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# sql.pegjs

## THIS PROJECT IS DEPRECATED, PLEASE FORK YOUR OWN

**[WARN]https://github.com/steveyen/sqld3 seems just a toy, so do not use both projects of us.**

This project is a SQL parser based on PEG([parsing expression grammar](http://en.wikipedia.org/wiki/Parsing_expression_grammar)).

And the `sql.pegjs` file is modified from [https://github.com/steveyen/sqld3](https://github.com/steveyen/sqld3).

Thanks for the effort of @steveyen.

## Usage

```js
var parser = require('sql.pegjs');
var sql = 'select * from users;';
parser.parse(sql)
// => [{"stmt":"select","select_cores":[{"results":[{"column":"*"}],"from":[{"table":"users"}]}]}]);

```

## How to contribute

1. modify `lib/sql.pegjs` and add tests.

1. run `make build`

1. then run `make test`

## License

MIT